Repository navigation
fix(update): treat channel health-collection timeouts as warnings during post-update verification - #165852
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed October 6, 2026, 10:27 PM ET / October 7, 2026, 02:27 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR turns channel health-collection deadlines into update warnings, preserves completed negative checks, and carries timeout diagnostics into health output and update reports. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 3 items remain The fix remains useful, but the previous account-level failure finding is still unresolved in the rebased head. Current main still treats collection timeouts as failures. Likely related people: steipete and RomneyDa are routing candidates based on prior update-readiness and CLI diagnostics work; source-line introduction attribution remains unverified. Priority: P1 Review scores
Verification
How this fits togetherThe Gateway collects health results for configured channel accounts. The updater combines those results with service identity, version, HTTP readiness, and process stability to decide whether an update succeeded. flowchart TD
A[Configured channel accounts] --> B[Gateway health collection]
B --> C[Health response]
C --> D[Restart health classification]
E[Service identity and HTTP readiness] --> F[Update verification]
D --> F
F --> G[Update result and warning report]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +82, Tests +165, Docs +9. Total +256 across 12 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Keep collection deadlines advisory while making definitive failures from relevant active accounts outrank timeouts within each channel. Do we have a high-confidence way to reproduce the issue? Yes, from source: a public health response with a preferred-account timeout and a sanitized definitive sibling failure leaves channelProbeErrors empty. This review did not execute that path. Is this the best way to solve the issue? The warning approach fits the update contract, but the current classifier is incomplete; account-level failures must take precedence before the candidate can be accepted. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against af716af2a545. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Keep collection deadlines distinct from definitive channel failures, preserving Gateway identity and HTTP readiness checks. Retain warnings in update reports and preserve observed probe failures through later summary deadlines.
4612de3 to
c7603be
Compare
…ing post-update verification (openclaw#165852) Closes openclaw#157319 Reported by @vasaeru; independent reproduction by @jlapenna.
…rnings (#169037) Backport of 48a3480 (#169037) adapted for 2026.10.2. A run the ledger finalized as succeeded now reports success with a warning (exit 0) when a later publication step fails, instead of claiming recovery is pending. Update repair warns about configured channel accounts still stopped or suppressed after repair without failing the update. Adaptations for the release line: - The release line lacks #165852's channel health-collection timeout plumbing (channelProbeTimeouts). Only channelRuntimeWarnings is added; readChannelProbeErrors becomes readChannelProbeFailures returning { errors, warnings } and keeps this line's probe-error semantics, and verification derives its channel warnings from channelRuntimeWarnings. - restart-health-inspect keeps this line's unmanaged-reachable early return instead of main's merged snapshot path (main's healthy-gating differs here); both snapshot constructions carry the warnings. - On this line exitCliAfterOutput(defaultRuntime, 0) throws ExitError, so the update failure triage handler now rethrows ExitError (the matching hunk of #168587 on main). Without it the success warning's exit would be triaged as an update failure; the ported completed-publication test fails without this hunk. (cherry picked from commit 48a3480)
What Problem This Solves
Fixes otherwise healthy updates failing verification or rolling back solely because channel health collection reaches its seven-second deadline.
Closes #157319. Thanks @vasaeru and @jlapenna for the original report and independent reproduction.
User Impact
Collection timeouts become named warnings in the update result, history, report, and health output. The Gateway must still answer, match the expected version/build, pass HTTP readiness, and retain a stable running generation. Definitive channel failures, including mixed timeout/error results, still fail verification. A warning does not claim that the affected channel was proven healthy.
Updated Gateways also avoid reporting a collection timeout as a negative probe to an already-running older updater. Older updater reports cannot acquire the new warning projection. This adds no timeout increase, retry loop, configuration/CLI option, dependency, or schema change.
Why This Change Was Made
The collector returned both
ok: falseandtimedOut: true; the restart probe discarded the timeout marker and rejected verification before HTTP readiness. #158163 improved backup and rollback without changing this classification.The collector now leaves the boolean outcome unset for an inconclusive timeout. The current probe separates healthy, unhealthy, and timed-out results, and the readiness owner retains timeout warnings across later observations. Existing update-step warnings carry them into reports. A completed, audience-safe negative probe also survives a deadline reached during a later summary hook; public probe redaction and unfinished-work permits remain intact.
Evidence
Rebase validation (2026-10-06)
Rebased
4612de38d5b4c03485b619d0b351f8a50c1d2fdeonto capturedorigin/mainata6496a2c5d1aee637a9c7fe0381ec2fc1ce524bb; new head:c7603be2d1eca20e03acba77c74f58c7e15ef95c. Pushed with an explicit force-with-lease against the original head.Read main commit
b898c261539dbbdbaedfe2c7b681dbc37fe6481a("fix(cli): use plain language for connection checks", #165740) before resolving its two conflicts inrestart-health-probe.tsandrestart-health-diagnostics.ts. Both intents are retained: main's "check failed" fallback and "Channel health check errors" heading, plus this PR's distinct timeout classification and warning behavior. The range-diff contains only those wording adaptations; conflict resolution adds no functional production changes.Final local proof used isolated
OPENCLAW_STATE_DIRand dependencies aligned to the rebased lockfile withpnpm install --frozen-lockfile(no manifest or lockfile edits):node scripts/run-vitest.mjs src/gateway/health/collector.deadline.test.ts src/cli/update-cli/update-command-verification.test.ts src/commands/health-format.test.ts src/cli/daemon-cli/restart-health-probe.test.ts src/cli/daemon-cli/restart-health-wait.test.ts: 169 tests passed across five suites; exit 0; 232.909 s command wall. The collector file reported 169.98 s, dominated by compilation/setup (including 130.867 s shared worker preparation), with about 12 s test execution.node scripts/check-changed.mjs --base a6496a2c5d1aee637a9c7fe0381ec2fc1ce524bb: exit 0; 2052.758 s, including core types, all 27 test type graphs, formatting, lint, dead exports, and repository guards.Original authoring evidence (before this rebase)
Regressions reproduced the original timeout-to-failure classification and missing warnings before the repair. Separate deadline regressions demonstrated that a completed negative probe could be lost behind a slow summary hook; admin failures and sanitized public iMessage failures now survive, while other private probe details stay withheld. The collector fixtures also release pending probes after an assertion failure, preventing cascading permit leaks.
node scripts/run-vitest.mjs <importer files>: exit 0, 2492.434 s including runtime preparation. No skips were added.node scripts/check-changed.mjs: exit 0, 742.979 s, including core types, all 27 test type graphs, lint, dead exports, formatting, and repository guards. Earlier validation caught a missing redaction-context field and three mechanical lint findings; those were corrected before this final pass.Changed-file costs using the canonical
node scripts/run-vitest.mjs <file> --maxWorkers=1wrapper forpnpm test <file> --maxWorkers=1:src/gateway/health/collector.deadline.test.tssrc/cli/update-cli/update-command-verification.test.tssrc/commands/health-format.test.tsCI seconds are pending at the authoring handoff; hosted CI is not represented as completed proof.
Production +105/−23 (net +82); tests +204/−39 (net +165); docs +9/−0.
Existing importer test costs
The unchanged process/installation/database fixtures retain their real compositions. These are sums of reported testcase times, not file wall times; no timeout, retry, assertion, or concurrency setting was weakened.
update-command-database-rollback.test.tsgit-edited)update-command-original-service.test.tspackage-root-missing)update-command-lease.test.tsupdate-command-service.integration.test.tsupdate-finalization-output.process.test.tsPublished-driver compatibility boundary: executed the exact channel classifier and snapshot finalizer from release commit
fc23bc864e4553c2d215e479eeec47b67a0bf943against the original and candidate timeout producers. Original timeout: one channel error/rejected; candidate timeout: zero channel errors/accepted; definitive negative: one error/rejected. This is an executable source-boundary cell, not a full package update or live channel test. All local proof used isolated state; no operator Gateway was changed.The seven-second cap originated in
2d7b1d21d3527b2f218f3d49dcf888622c38e67ato finish within the eight-secondstatus --allhealth budget; that bound is unchanged.