Repository navigation
fix(update): name the last health probe when Gateway readiness times out - #182858
Conversation
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.
|
🦞👀 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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis 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.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete 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 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe 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]
Technical reviewBest 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
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +6, Tests +59, Docs +2. Total +67 across 3 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 24, 2026, 4:36 PM ET / 20:36 UTC. |
|
Merged via squash.
|
…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.
What Problem This Solves
Fixes: a failed
openclaw updatenames only the read the deadline happened to interrupt (for exampleGateway 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 devruns on a production Gateway failed after 30+30 minutes with just thatsettled/timeoutfailure 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 v3Operators 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
/startupzand/readyzidentity. This PR is diagnostics only, so any future never-healthy wait explains itself.Evidence
update-command-verification.test.tsdrivesverifyUpdatedGatewaythrough a real readiness wait. One observation is rejected withPROTOCOL_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 thesettled/timeoutfailure 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.update-command-verification.test.tsand allrestart-health*.test.ts(9 files, 133 tests)pnpm tsgo:coreclean; oxfmt clean on touched files.openclaw updatecapture. Reproducing it would need an isolated Gateway that rejects the retained verifier's handshake and then stallslsofpast 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 indocs/install/updating.md.