Skip to content

fix(update): name the last health probe when Gateway readiness times out - #182858

Merged
steipete merged 1 commit into
mainfrom
fix/update-readiness-last-probe-error
Oct 25, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/update-readiness-last-probe-error

Conversation

@steipete

@steipete steipete commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: a failed openclaw update names only the read the deadline happened to interrupt (for example Gateway restart observation timed out during health-wait:port-inspection) when the restarted Gateway never becomes healthy, hiding the actual cause.

On 2026-10-24 two native openclaw update --channel dev runs on a production Gateway failed after 30+30 minutes with just that settled/timeout failure fact. The real cause was that every readiness RPC handshake was rejected with a protocol mismatch, which only showed up in the updater's stderr progress lines. Port inspection was simply the slowest read on a loaded host when the deadline fired.

User Impact

User impact: when update readiness times out, the recorded failure fact, update report, and diagnostics now name both the interrupted read and the last health probe error. For example:

Gateway restart observation timed out during health-wait:port-inspection. Last health probe: protocol mismatch: Control UI v5, Gateway v4, connection check min v3

Operators and triage start from the actual rejection instead of chasing port inspection. Deadline timing, startup-phase reporting, and update outcomes are unchanged.

Why This Change Was Made

The readiness timeout handler deliberately drops the last snapshot's startup phase, because a hung read cannot claim earlier startup progress. It also discarded that snapshot's probe error, which is still the best answer to why readiness never settled. The handler now keeps the deadline message and appends the last observed probe error.

One edge needed care. When the deadline expires before the wait's first observation, the wait owner returns a placeholder snapshot whose probe error is Gateway readiness budget exhausted.. That is not a probe result, so it stays out of the message rather than producing "Last health probe: Gateway readiness budget exhausted."

The protocol-mismatch case itself is fixed by #182399, which verifies through HTTP /startupz and /readyz identity. This PR is diagnostics only, so any future never-healthy wait explains itself.

Evidence

  • New regression test in update-command-verification.test.ts drives verifyUpdatedGateway through a real readiness wait. One observation is rejected with PROTOCOL_MISMATCH, then the next port inspection hangs until the deadline fires.
    • observed=true: red on base (fact message was only the deadline line), green with the fix. It asserts the settled/timeout failure fact and the rendered update report.
    • observed=false: the deadline fires during the first port inspection. Removing the placeholder guard turns it red ("Last health probe: Gateway readiness budget exhausted."), so the guard is load-bearing.
  • Consumer suites pass locally:
    • update-command-verification.test.ts and all restart-health*.test.ts (9 files, 133 tests)
    • update service, timeouts, failure/native/post-update recovery, lifecycle, repair, guidance, predecessor/post-plugin readiness, Windows readiness, and deferred completion (13 files, 266 tests)
  • pnpm tsgo:core clean; oxfmt clean on touched files.
  • Codex autoreview (P2 scope): scoped-clean, no findings.
  • Gap: no end-to-end openclaw update capture. Reproducing it would need an isolated Gateway that rejects the retained verifier's handshake and then stalls lsof past the readiness budget. The change only composes the recorded diagnostic message; deadline timing and outcomes are untouched, and the test drives the real verification and report path with mocked RPC and port inspection.

Production delta: +8/−3 in update-command-readiness.ts; one docs sentence in docs/install/updating.md.

A readiness deadline in a non-interval read replaced the last observed
probe error with only the interrupted phase, so a never-healthy update
reported "timed out during health-wait:port-inspection" while the real
cause (an RPC protocol mismatch from the retained verifier) appeared only
in stderr progress lines.

Keep the deadline message and append the last health probe error. A wait
that expires before its first observation returns a budget placeholder,
which is not a probe result and stays out of the message. Deadline
semantics, the interval startup-phase rule, and outcomes are unchanged.
@clawsweeper

clawsweeper Bot commented Oct 24, 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.

@steipete
steipete marked this pull request as ready for review October 24, 2026 20:21
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T20:23:01.740814Z 4a30857 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes size: S labels Oct 24, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 24, 2026
@clawsweeper

clawsweeper Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR appends the last observed health probe error to Gateway readiness timeout diagnostics.

Example: A protocol-5 updater observes a protocol-4 rejection, then its next port inspection exceeds the readiness deadline.

  • Before: The recorded failure names only health-wait:port-inspection.
  • After: The failure also includes: Last health probe: protocol mismatch: Control UI v5, Gateway v4, connection check min v3.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-supported diagnostic repair with distinct regression coverage, limited to reported harness validation.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; supplied validation exercises verifyUpdatedGateway and report rendering with mocked RPC and port inspection rather than a shipped CLI timeout.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A failed update points operators at the interrupted port inspection instead of the health rejection that prevented readiness.
Reason: The maintainer-authored direction addresses an observed diagnostic failure without adding settings, changing acceptance criteria, or introducing another owner.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it fixes a source-confirmed diagnostic loss with a focused change, and no actionable correctness or security finding was identified.

Priority: P2
Reviewed head: 4a30857aa3b5a7c66cc971a54b2e3b38eaac93c5

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No supplied shipped openclaw update run demonstrates the appended timeout diagnostic after a real failed health observation.
Agent review details

How this fits together

The update readiness owner combines native service observations and Gateway health probes, then supplies verification facts and diagnostics to update reports and recovery.

flowchart TD
  A[Update CLI] --> B[Update readiness owner]
  B --> C[Restart health wait]
  C --> D[Service and Gateway probes]
  D --> C
  C --> B
  B --> E[Verification failure facts]
  E --> F[Update report and diagnostics]
Loading

Technical review

Best possible solution:

Keep the existing readiness owner and preserve its last real probe error alongside the interrupted-read diagnostic.

Do we have a high-confidence way to reproduce the issue?

Current-main source explicitly discards the probe error on non-interval deadline expiry, and the supplied regression models a completed rejection followed by hung port inspection; no target code was run during this review.

Is this the best way to solve the issue?

This is the smallest complete repair in the existing owner: retain the real observation, exclude the pre-observation placeholder, and preserve deadline and startup-phase semantics.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Readiness timeout handling changes intended behavior with a stated reason (018639a: Bound readiness reads and preserve observed interval-expiry failures without allowing a hung observation to inherit earlier startup progress.)
  • Update readiness documentation keeps the original intent (fb5692c: Explain retained-updater protocol differences and HTTP identity verification across protocol changes.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 018639a adds src/cli/update-cli/update-command-readiness.ts:310 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 018639af3b54; files: src/cli/update-cli/update-command-readiness.ts)
  • Jason (Json): Raw commit 97c7b35 adds src/cli/update-cli/update-command-readiness.ts:188 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 97c7b3593392; files: src/cli/update-cli/update-command-readiness.ts)

PR surface

Source +6, Tests +59, Docs +2. Total +67 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 9 3 +6
Tests 1 59 0 +59
Docs 1 3 1 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 71 4 +67

Labels

Label changes:

  • add P2: Misleading timeout diagnostics increase operator troubleshooting effort, while this patch leaves readiness outcomes and recovery behavior unchanged.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Misleading timeout diagnostics increase operator troubleshooting effort, while this patch leaves readiness outcomes and recovery behavior unchanged.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

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

  • Optionally add redacted CLI output showing a real health rejection retained when the subsequent readiness read times out.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 24, 2026, 4:36 PM ET / 20:36 UTC.

@steipete
steipete merged commit 258e7be into main Oct 25, 2026
217 of 219 checks passed
@steipete
steipete deleted the fix/update-readiness-last-probe-error branch October 25, 2026 06:16
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 26, 2026
…nclaw#182858)

A readiness deadline in a non-interval read replaced the last observed
probe error with only the interrupted phase, so a never-healthy update
reported "timed out during health-wait:port-inspection" while the real
cause (an RPC protocol mismatch from the retained verifier) appeared only
in stderr progress lines.

Keep the deadline message and append the last health probe error. A wait
that expires before its first observation returns a budget placeholder,
which is not a probe result and stays out of the message. Deadline
semantics, the interval startup-phase rule, and outcomes are unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant