Repository navigation
fix: show managed update helper startup failures - #181402
Conversation
Preserve bounded, redacted helper startup diagnostics in update failure checks and reports before cleanup. Keep the serving Gateway and existing handoff ownership unchanged. Refs #181337. Thanks @Chengmun58 for reporting the missing startup diagnostics.
|
🦞👀 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4f67243125
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "handoff-helper-exited": | ||
| "The update helper exited before acknowledging the handoff. Run openclaw doctor, then retry openclaw update from an external terminal to inspect its startup failure.", | ||
| "The update helper exited before acknowledging the handoff. Check the helper startup diagnostics in this update report, correct the reported problem, then retry the update. The Gateway kept serving.", |
There was a problem hiding this comment.
Preserve a fallback when startup diagnostics are absent
When handoff.log cannot be opened/read or the helper exits without writing a diagnostic (for example, a signal-only exit), readHandoffStartupFailure returns the original error, but this message still tells the user to inspect and correct nonexistent diagnostics. The previous Doctor/external-terminal recovery guidance is therefore lost precisely on the best-effort capture path; retain that fallback here or select the new wording only when a diagnostic fact was captured. This is required so update errors continue to name an actionable next step.
AGENTS.md reference: AGENTS.md:L74-L77
Useful? React with 👍 / 👎.
|
Codex review: needs changes before merge. What this changesThis PR retains bounded, redacted managed-helper startup errors in update history and reports before deleting temporary files. Example: The managed update helper exits with an EACCES startup exception containing token=fixture-private-token.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness⛔ Needs changes before merge - 1 item remains Keep this PR open: it addresses a verified diagnostic gap with live evidence, but one focused recovery-guidance defect remains. Priority: P2 Before merge
Findings
Agent review detailsHow this fits togetherThe Gateway's update.run handler launches the installed updater's detached helper; startup failures flow through existing failure facts into update history and local or public reports. flowchart TD
A[Control UI update request] --> B[Gateway update.run]
B --> C[Managed handoff owner]
C --> D[Detached helper]
D --> E[Private helper log]
E --> F[Bounded redacted failure facts]
F --> G[Update history and reports]
Technical reviewBest possible solution: Keep diagnostic capture in the existing handoff owner and preserve an actionable recovery fallback when capture produces no useful output. Do we have a high-confidence way to reproduce the issue? Current-main source demonstrates the diagnostic loss: stderr is ignored and the helper directory is deleted after readiness failure; the supplied live RPC trace demonstrates capture after the patch, while the original Windows exception remains unknown. Is this the best way to solve the issue? Capturing the existing private log before cleanup is a focused repair using established redaction and failure-fact owners; the reader and two regression cases are justified without another lifecycle or storage owner. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d09e172f0b5a. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +60, Tests +68, Docs +4. Total +132 across 5 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
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 23, 2026, 2:19 AM ET / 06:19 UTC. |
…1402) When the managed-service update handoff helper exited before signaling readiness, the launcher discarded its stderr and deleted its startup log before recording the cause, so users (e.g. Windows Control UI updates) only saw 'inspect its startup failure from an external terminal'. The launcher now captures a bounded 8 KiB tail, redacts it with the existing redaction helpers before cleanup, and includes the bounded diagnostic in the failure check and update report. Refs openclaw#181337, reported by @Chengmun58.
Refs #181337. Thanks @Chengmun58 for the report.
What Problem This Solves
When a managed update helper exits before readiness, the Control UI reports only the exit code and asks the user to diagnose it from another terminal. The launcher discarded stderr and deleted the helper's own startup log before retaining its cause.
User Impact
Update history and the local update report now retain bounded, redacted startup diagnostics, including an engine incompatibility or an arbitrary startup exception. The original Gateway keeps serving when handoff fails. The capture must be present in the installed updater; it cannot repair an older updater already running.
Why This Change Was Made
The handoff owner sends stderr to its existing private helper log, then reads at most 8 KiB before cleanup. It retains the first error and final diagnostic lines in the existing 200-character failure facts. Diagnostic capture remains best effort, and the readiness, ownership, and cleanup contracts stay in place. Public support exports retain their existing stricter redaction policy.
The helper starts installed code, not the target package. #180769 already adds the target Node-engine preflight before package staging, after the helper starts. Node 24.21.0 is below the reported target's requirement, but that alone does not establish the cause of the original Windows helper exit. This PR references the issue rather than claiming that unseen startup exception is fixed.
Evidence
update.runhandler, detached process, persisted failure facts, and rendered report. Cases cover a multi-line Node engine error and oversized stderr with a synthetic secret.update.runRPC returned the injectedEACCESstartup error with the synthetic token redacted. Health was HTTP 200 before and after; the isolated Gateway then shut down cleanly. No installed service was stopped or restarted.git diff --checkpassed. Madge reported zero import cycles.src/cli/update-cli.test.ts→rejects a malformed inferred JSON dev target before running the update: the externalTMPDIRhas a group-writable ancestor, so the SQLite staging owner emits an additional warning. The same test fails identically on untouched basec65a35325cd00ebbed2094fb353391078b090df3and passes on this patch with the native private temp directory. No assertion or production behavior was weakened.update-command-original-service.test.ts256.11s;update-managed-service-handoff-recovery-launchd.test.ts163.66s;update-managed-service-handoff-recovery-systemd.test.ts153.60s;update-managed-service-handoff-foreground.test.ts147.27s;update-cli.test.ts141.55s;update-cli.candidate-activation.test.ts140.00s. No individual test exceeded 30s.update-command-fresh-preview.test.tsalso took 125.28s in the remaining run. Total first-run wall time: 2539.65s.check:changedwas not run because of its SQLite inventory cost; the scoped checks above were run, and PR CI supplies broad proof. Native Windows execution was not available.Local live proof commands and result
The synthetic preload exits only when Node starts
handoff.cjs, emitting anEACCESstartup error and a fake token. The RPC driver uses the productioncallGatewayCliclient to callupdate.runwith{}and asserts HTTP health before and after.Production delta: +64/-4 lines; tests: +68/-0; docs: +4/-0. The growth is the bounded diagnostic reader and real-process regression fixture; there is no new storage schema, dependency, or configuration option.