Skip to content

fix(update): treat channel health-collection timeouts as warnings during post-update verification - #165852

Merged
steipete merged 1 commit into
mainfrom
upd/upd-verify-health-timeout-warning
Oct 7, 2026
Merged

steipete merged 1 commit into
mainfrom
upd/upd-verify-health-timeout-warning

Conversation

@steipete

@steipete steipete commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

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: false and timedOut: 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 4612de38d5b4c03485b619d0b351f8a50c1d2fde onto captured origin/main at a6496a2c5d1aee637a9c7fe0381ec2fc1ce524bb; 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 in restart-health-probe.ts and restart-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_DIR and dependencies aligned to the rebased lockfile with pnpm 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.
  • PR delta remains 12 files, +318/−62: production +105/−23, tests +204/−39, docs +9/−0. Auto-merge remains off. Hosted CI was not awaited for this rebase handoff.

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.

  • Five focused suites: 169 tests passed three times on the final patch. First pass, measured as four serialized commands: 63.591 s; subsequent complete passes: 19.577 / 32.519 s.
  • Direct and one-barrel importers, supplied in the original manifest order: 74 files selected; 73 passed and one existing Linux-only file skipped; 1,792 tests passed and 14 existing platform cases skipped. node scripts/run-vitest.mjs <importer files>: exit 0, 2492.434 s including runtime preparation. No skips were added.
  • Full 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.
  • Required importer runtime build: passed in 18m 30.9s. This is shared build preparation, separate from test execution.
  • Automated P1 review unavailable: Codex returned a transport failure without an assessment; the managed fallback failed immediately because its OAuth session expired, with zero tokens processed. No independent clean verdict is claimed; maintainer review remains required. Auto-merge is off.

Changed-file costs using the canonical node scripts/run-vitest.mjs <file> --maxWorkers=1 wrapper for pnpm test <file> --maxWorkers=1:

Test file Command wall
src/gateway/health/collector.deadline.test.ts 32.905 s
src/cli/update-cli/update-command-verification.test.ts 16.337 s
src/commands/health-format.test.ts 2.736 s

CI 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.

Existing file Summed test time Longest case
update-command-database-rollback.test.ts 268.119 s 36.666 s (git-edited)
update-command-original-service.test.ts 399.674 s 39.627 s (package-root-missing)
update-command-lease.test.ts 187.748 s 13.536 s
update-command-service.integration.test.ts 159.770 s 9.341 s
update-finalization-output.process.test.ts 151.330 s 26.649 s

Published-driver compatibility boundary: executed the exact channel classifier and snapshot finalizer from release commit fc23bc864e4553c2d215e479eeec47b67a0bf943 against 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 2d7b1d21d3527b2f218f3d49dcf888622c38e67a to finish within the eight-second status --all health budget; that bound is unchanged.

@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime cli CLI command changes commands Command implementations size: M labels Oct 5, 2026
@steipete
steipete marked this pull request as ready for review October 5, 2026 23:49
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 5, 2026
@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 6, 2026, 10:27 PM ET / October 7, 2026, 02:27 UTC (Revision 2).

ClawSweeper review

What this changes

The PR turns channel health-collection deadlines into update warnings, preserves completed negative checks, and carries timeout diagnostics into health output and update reports.

Regression provenance

Possible 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
Reviewed head: c7603be2d1eca20e03acba77c74f58c7e15ef95c

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch has substantial focused validation, but the unresolved mixed-account classification bug prevents merge readiness.
Proof confidence 🌊 off-meta tidepool Not applicable: The repository-state MEMBER association exempts this PR from external-contributor runtime proof. Reported collector and verification tests exercise the changed owners with mocked channel/RPC results and real loopback HTTP; the published-driver source-boundary cell is supplemental compatibility evidence. No authority-bearing value or stored-data contract changes.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The repository-state MEMBER association exempts this PR from external-contributor runtime proof. Reported collector and verification tests exercise the changed owners with mocked channel/RPC results and real loopback HTTP; the published-driver source-boundary cell is supplemental compatibility evidence. No authority-bearing value or stored-data contract changes.
Evidence reviewed 10 items Introduced classification misses sibling accounts: The introduced classifier reads only summary.probe and classifies a timeout as advisory. It never examines summary.accounts, so a preferred-account timeout can hide a sibling's definitive negative.
Collector preserves distinct account results: The collector spreads the preferred account into the channel summary and separately retains every account in accounts. A sibling negative does not replace the preferred timeout in the top-level probe.
Reachable through public health results: Public health retains sanitized iMessage Full Disk Access failures with ok:false. The read-scoped restart health request can therefore receive a preferred timeout alongside a definitive sibling failure; this does not depend on private admin-only diagnostics.
Findings 1 actionable finding [P2] [P2] Check account-level failures before accepting a channel timeout
Security None None.

How this fits together

The 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]
Loading

Before merge

  • [P2] Check account-level failures before accepting a channel timeout (P2) - When the preferred account reaches the collection deadline but a sibling returns a definitive negative, the collector puts the timeout in summary.probe and retains the negative in summary.accounts. This classifier reads only the former, so the new advisory classification leaves channelProbeErrors empty and update verification can succeed. This is reachable with cached public iMessage health, which retains sanitized Full Disk Access failures. Inspect relevant active account probes with definitive failures outranking timeouts, and extend the mixed regression to accounts within one channel. The previous review raised this same blocker; it remains unresolved.
  • Resolve merge risk (P1) - Update verification can report success while a configured sibling account has a definitive health failure, when the preferred account times out.
  • Complete next step (P2) - Inspect relevant active account probes with definitive failures outranking timeouts, and add a same-channel mixed-account verification regression.

Findings

  • [P2] [P2] Check account-level failures before accepting a channel timeout — src/cli/daemon-cli/restart-health-probe.ts:215-225
Agent review details

Security

None.

PR surface

Source +82, Tests +165, Docs +9. Total +256 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 8 105 23 +82
Tests 3 204 39 +165
Docs 1 9 0 +9
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 12 318 62 +256

Review metrics

Metric Value Why it matters
Production and regression growth production +105/−23, net +82; tests +204/−39, net +165 The stated growth carries timeout classification and warnings through existing owners and preserves observed negatives across later summary deadlines.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #157319
Summary: This PR is a candidate repair for the issue's channel collection-timeout failure; the issue also contains separate Codex process and metadata-preflight problems.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Classify account failures before timeouts (recommended)
    Inspect relevant active account probes and add a within-channel regression so an inconclusive preferred account cannot hide a definitive sibling failure.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Repair restart health classification to inspect relevant active account probes as well as the channel summary, with definitive failures outranking collection timeouts; add a same-channel mixed-account regression and preserve existing redaction, readiness, generation, and published-driver compatibility contracts.

Technical review

Best 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:

  • [P2] [P2] Check account-level failures before accepting a channel timeout — src/cli/daemon-cli/restart-health-probe.ts:215-225
    When the preferred account reaches the collection deadline but a sibling returns a definitive negative, the collector puts the timeout in summary.probe and retains the negative in summary.accounts. This classifier reads only the former, so the new advisory classification leaves channelProbeErrors empty and update verification can succeed. This is reachable with cached public iMessage health, which retains sanitized Full Disk Access failures. Inspect relevant active account probes with definitive failures outranking timeouts, and extend the mixed regression to accounts within one channel. The previous review raised this same blocker; it remains unresolved.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against af716af2a545.

Labels

Label changes:

  • add merge-risk: 🚨 availability: The introduced advisory classification can accept a candidate despite a definitive sibling-account health failure.

Label justifications:

  • P1: The repair addresses reported update verification failures that leave real installations running an unverified candidate.
  • merge-risk: 🚨 availability: The introduced advisory classification can accept a candidate despite a definitive sibling-account health failure.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The repository-state MEMBER association exempts this PR from external-contributor runtime proof. Reported collector and verification tests exercise the changed owners with mocked channel/RPC results and real loopback HTTP; the published-driver source-boundary cell is supplemental compatibility evidence. No authority-bearing value or stored-data contract changes.

Evidence

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs src/cli/update-cli/update-command-verification.test.ts src/cli/daemon-cli/restart-health-probe.test.ts src/cli/daemon-cli/restart-health-wait.test.ts src/gateway/health/collector.deadline.test.ts src/commands/health-format.test.ts.
  • [P1] node scripts/check-changed.mjs --base a6496a2.
  • [P1] git diff --check.

What I checked:

  • Introduced classification misses sibling accounts: The introduced classifier reads only summary.probe and classifies a timeout as advisory. It never examines summary.accounts, so a preferred-account timeout can hide a sibling's definitive negative. (src/cli/daemon-cli/restart-health-probe.ts:216, c7603be2d1ec)
  • Collector preserves distinct account results: The collector spreads the preferred account into the channel summary and separately retains every account in accounts. A sibling negative does not replace the preferred timeout in the top-level probe. (src/gateway/health/collector.ts:623, c7603be2d1ec)
  • Reachable through public health results: Public health retains sanitized iMessage Full Disk Access failures with ok:false. The read-scoped restart health request can therefore receive a preferred timeout alongside a definitive sibling failure; this does not depend on private admin-only diagnostics. (src/gateway/health/account-context.ts:17, c7603be2d1ec)
  • Mixed regression covers channels rather than accounts: The new mixed case supplies a Telegram timeout and a Discord failure. It does not supply conflicting account results within one channel, leaving the prior finding uncovered. (src/cli/update-cli/update-command-verification.test.ts:123, c7603be2d1ec)
  • Finding survives the actual test merge: The test merge's raw parents are the pinned base followed by the exact PR head. Its classifier delta retains the same account-blind timeout classification, establishing that this concern survives merging rather than arising from endpoint drift. (src/cli/daemon-cli/restart-health-probe.ts:216, c0832f4f2e53)
  • Current main still needs the timeout repair: Fetched main still uses readChannelProbeErrors and treats a top-level ok:false as a definitive failure without separating timedOut. The related merged rollback and plain-language PRs do not implement this classification repair. (src/cli/daemon-cli/restart-health-probe.ts:207, af716af2a545)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • RomneyDa: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add account-level classification and a regression proving a preferred timeout cannot hide an active sibling's definitive failure.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-05T23:55:57.472Z sha 4612de3 :: needs changes before merge. :: [P2] [P2] Check account-level failures before accepting a channel timeout

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.
@steipete
steipete force-pushed the upd/upd-verify-health-timeout-warning branch from 4612de3 to c7603be Compare October 7, 2026 02:20
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. label Oct 7, 2026
@steipete
steipete merged commit e7546f2 into main Oct 7, 2026
133 checks passed
@steipete
steipete deleted the upd/upd-verify-health-timeout-warning branch October 7, 2026 03:31
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 7, 2026
…ing post-update verification (openclaw#165852)

Closes openclaw#157319

Reported by @vasaeru; independent reproduction by @jlapenna.
RomneyDa pushed a commit that referenced this pull request Oct 11, 2026
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update to 2026.9.6 failed verification: state-migrated-no-rollback + codex plugin stale app-server records block catalog refresh

1 participant