Repository navigation
fix(update): failed-update records hide the triggering error behind the excerpt tail - #144729
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. |
A failed update step's stderr leads with the triggering error and ends with the outcome, but the failure record capped each step's stderr excerpt to a tail-only 160-byte slice, so the leading swap or install error reached the failure JSON and the triage prompt as a mid-word fragment with no root cause. Keep both ends for stderr with the sanitizer's existing ends mode at a 384-byte cap: the tail half stays wider than the previous tail-only window, so every excerpt that was visible before remains visible, and the head now carries the triggering error. stdout excerpts keep their tail-only outcome form, and the run-record summary keeps its final-lines-only contract; both boundaries are noted in openclaw#144712. Related: openclaw#144712
04112e2 to
5e98327
Compare
|
Codex review: needs maintainer review before merge. Reviewed September 11, 2026, 4:32 AM ET / 08:32 UTC (Revision 3). ClawSweeper reviewWhat this changesPreserve both ends of failed-update stderr in saved diagnostics and triage prompts, with regression coverage. Merge readiness✅ Ready for maintainer review The fix remains necessary: current main and v2026.9.4 still discard the leading diagnostic. The supplied real-update evidence supports the change, and this review found no blocking defect. Priority: P2 Review scores
Verification
How this fits togetherThe updater passes failed-step output through a shared sanitizer before saving support records or preparing repair prompts. This change improves the diagnostic excerpt without changing update execution or rollback decisions. flowchart LR
A[Failed update step] --> B[Captured error output]
B --> C[Redact private information]
C --> D[Keep bounded beginning and end]
D --> E[Saved failure record]
D --> F[Repair prompt]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +3, Tests +36. Total +39 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep diagnostic excerpt selection in the shared sanitizer while leaving rollback verification and recovery guidance to the broader linked issue. Do we have a high-confidence way to reproduce the issue? Yes, source establishes that sufficiently long stderr loses its leading error under current main's tail-only excerpt; the linked report supplies real examples. This review did not execute an update. Is this the best way to solve the issue? Yes, reusing the existing bounded excerpt mode in the shared sanitizer is a focused repair, supported by a saved-artifact regression and real after-fix output. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f6b64c3915ee. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Merged via squash.
|
Preserve the reviewed harness while incorporating the landed benchmark prerequisite. Punchcard-Session: coral-orchard-orchard-d4 * commit '4407ed19ac63b1c1c84a0cfe6eb4bbeca9c2322c': (1196 commits) fix(perf): isolate benchmark subprocess transport (#144159) refactor(auth): await Copilot cache persistence (#144810) refactor(web-fetch): exercise URL normalization through the public tool (#144887) fix(ollama): preserve hosted subdomain model context (#144891) fix(doctor): explain Codex plugin health failures (#144813) fix(channels): honor pinned accounts in Mattermost model menus (#144880) fix(update): failed-update records hide the triggering error behind the excerpt tail (#144729) fix(logging): preserve OpenClaw package references in diagnostics (#144808) fix: retain plugin detail tab selections while inspection loads (#144647) fix: keep discovered models when sign-in tokens renew (#144861) fix(update): preserve local package overrides (#89985) fix(update): resolve compatibility bridges within the runtime graph (#144831) chore(i18n): refresh native locales (#144856) fix: preserve child signal termination during CLI respawn (#144838) fix(text): hide encoded MiniMax tool envelopes (#126307) fix(subagents): deliver child replies that match the empty placeholder (#130647) fix(cli): reject blank message channel selectors (#144802) fix(telegram): preserve mixed text order and pending stop (#144839) fix(memory): restore FTS fallback for same-name view collisions (#144783) chore(release): close out 2026.9.4 on main (#144708) ...
…he excerpt tail (openclaw#144729) Preserve the triggering error in failed-update diagnostic records and triage prompts by using the shared sanitizer's existing 384-byte head-and-tail stderr excerpt. The previous 160-byte tail-only excerpt could erase the initiating error behind rollback details. The saved-artifact regression covers both the leading diagnostic and final recovery verdict. Redaction still precedes truncation, and the diagnostic JSON and triage prompt retain their existing 4 KiB and 8 KiB bounds. Update execution, rollback decisions, and ledger summaries are unchanged. Related: openclaw#144712. This repairs its diagnostic-loss symptom; openclaw#144758 addresses the triggering update failure. Validation: exact-head CI run 34579194228 succeeded, including build, lint, types, and test shards. ClawSweeper found no blocking defect; independent maintainer review was clean at P0/P1. Contributor-recorded isolated update output retains the leading timeout and final recovery verdict. Contributor code was not executed locally during landing. Thanks @Richard355168. Co-authored-by: Richard355168 <[email protected]>
Related: #144712 (the failure-record observability half; the rollback-verification design and docs asks there remain open)
What Problem This Solves
Fixes an issue where operators diagnosing a failed
openclaw updatewould lose the triggering error whenever a failed step's stderr exceeded the excerpt budget: the update-failure record caps each step's stderr excerpt to a tail-only 160-byte slice, so a multi-part diagnostic (leading error, then recovery verdict) reachesopenclaw-update-failure-*.jsonas a mid-word fragment with no root cause. Observed on a 2026.9.3 → 2026.9.4 npm user-global update (#144712): two deterministicglobal install swapfailures were recorded as…etained package tree changed …, and the swap error that started the rollback was unrecoverable from any artifact — diagnosing it required reading the updater source.Why This Change Was Made
Failed-step stderr leads with the triggering error and ends with the outcome, so the stderr excerpt keeps both ends: the sanitizer's existing
endsmode at a 384-byte cap. The tail half stays wider than the previous tail-only window, so every excerpt that was visible before remains visible; the head now carries the triggering error. stdout excerpts keep their tail-only outcome form. Excerpt caps elsewhere, the 4 KiB prompt-fit loop, and the run-record summary's final-lines-only contract are unchanged — that summary and the live console line are deliberately left as they are (their behavior is pinned byupdate-run-report.test.ts), and both are noted in #144712 for a separate discussion.User Impact
Operators and support agents reading
openclaw-update-failure-*.jsonor the update triage prompt now see the start of the triggering error (for example, the swap failure reason) next to the final recovery verdict instead of a truncated mid-word fragment, so failed-update diagnosis no longer requires source access. Previously visible excerpts remain visible.Evidence
src/commands/triage-update.test.tsgains a case whose stderr leads with the triggering error and spans multiple rollback detail lines: under the new excerpt the record contains the leading diagnostic, the outcome tail, and the ellipsis; the file's suite passes.triage-recovery.test.tsrelies on viaStringContainingdiagnostics.oxfmt --checkclean on the touched files; typecheck and lint run in CI.Real-behavior proof (after fix)
A real
openclaw updaterun (2026.9.3 → 2026.9.4, npm global install inside an isolated global prefix with a fresh state dir,--no-restart) reproduced the #144712 swap failure end to end — staging, migration rehearsal, doctor lint, config validation, plugin resolution, and the gateway canary all passed, thenglobal install swapexited 1, matching the deterministic failure reported from two machines. The failure record written by this patch retains both ends of the failed step's stderr:{"name": "global install swap", "exitCode": 1, "stderrTail": "Package rollback verification timed out Package rollback verification failed: retained package tree changed Installation recovery is unverified; inspect the installation and backups in <globalRoot> before restarting."}The leading sentence —
Package rollback verification timed out— is the triggering error that every pre-fix record erased: the two records in #144712 and the reporter's diagnostics all begin mid-word with…etained package tree changed. Under the previous 160-byte tail-only excerpt this head was unrecoverable; with the 384-byteendsexcerpt the whole excerpt fits under the cap and is preserved verbatim. The same run also surfaced the likely mechanism behind the deterministic failures: the swap's package integrity scan hits its time budget on real installation trees, which aborts the swap and starts the rollback whose re-verification then reports the tree as changed.