Repository navigation
fix(update): candidate config read failure warning omits its reason - #169284
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. |
|
Codex review: needs maintainer review before merge. What this changesThis PR adds bounded failure reasons to candidate-config warnings and preserves recognition of the previously shipped runtime alias. Example: The candidate reader cannot import the json5 dependency during an update.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR repairs a diagnostic defect still present on current main, and the latest type correction leaves no actionable patch finding. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe postbuild generator produces the stable config alias consumed by installed updaters after package replacement; it sends reads to a fresh child process and returns config values or a coded warning. flowchart TD
A[Installed updater] --> B[Candidate stable config alias]
B --> C[Fresh reader process]
C --> D[Candidate config runtime]
D --> E[Framed result]
E --> B
B --> F[Config value or bounded warning]
F --> A
Technical reviewBest possible solution: Retain the existing compatibility reader and fallback while exposing bounded failure reasons to the operator. Do we have a high-confidence way to reproduce the issue? Current-main source shows the discarded failure details, and the supplied published-driver trace demonstrates the before/after warning; no target code was executed during this review. Is this the best way to solve the issue? The repair belongs in the existing generated alias, preserves installed-updater compatibility, and avoids changing service-preparation policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 00809bf2c2a0. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +157, Docs +1, Other +17. Total +175 across 5 files. Added test files: 1. View PR surface stats
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 HistoryReview history (4 earlier review cycles)
Reviewed October 11, 2026, 10:50 PM ET / October 12, 2026, 02:50 UTC (Revision 5). |
|
@clawsweeper re-review Added published-driver × candidate proof to the PR body (published |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Pushed |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Pushed |
|
🦞👀 Re-review progress:
|
|
Admin-merging for the 2026.10.5-beta.2 release. The only red check is from an earlier attempt: |
…penclaw#169284) * docs: plan candidate config reader failure diagnostics * fix(update): report candidate config reader failure reasons Closes openclaw#169261 * test(update): pass explicit comparator in alias provenance test * test(update): keep alias provenance names typed as strings --------- Co-authored-by: Dallin Romney <[email protected]>
…169284) * docs: plan candidate config reader failure diagnostics * fix(update): report candidate config reader failure reasons Closes #169261 * test(update): pass explicit comparator in alias provenance test * test(update): keep alias provenance names typed as strings --------- Co-authored-by: Dallin Romney <[email protected]> (cherry picked from commit f67c8ff)
…169284) * docs: plan candidate config reader failure diagnostics * fix(update): report candidate config reader failure reasons Closes #169261 * test(update): pass explicit comparator in alias provenance test * test(update): keep alias provenance names typed as strings --------- Co-authored-by: Dallin Romney <[email protected]> Backport note for 2026.10.3: clean pick. 10.2 and 10.3 ship the same alias generator as 2026.10.5-beta.1, so the added 49fbd875 historical hash also keeps the shipped 10.2 alias recognized once 10.3 emits the new reason-reporting body. (cherry picked from commit f67c8ff)
…penclaw#169284) * docs: plan candidate config reader failure diagnostics * fix(update): report candidate config reader failure reasons Closes openclaw#169261 * test(update): pass explicit comparator in alias provenance test * test(update): keep alias provenance names typed as strings --------- Co-authored-by: Dallin Romney <[email protected]> (cherry picked from commit f67c8ff) (cherry picked from commit 354806a) Co-authored-by: RomneyDa <[email protected]>
Closes #169261
What Problem This Solves
Fixes: when an update's compatibility config read fails after package replacement,
candidate-config-read-failedgives no reason, so operators cannot tell what went wrong.User Impact
User impact: the warning now includes a single-line reason of up to 500 characters: the reader's error message and code, a spawn failure, a timeout, a kill signal, oversized output, or a non-zero exit without a result. The reader's stderr is still never echoed, because config diagnostics go there. The fallback is unchanged: the existing service definition is left alone and the update continues.
Update behavior: the reader lives in the candidate's generated
dist/io.runtime.js, which already-installed updaters import after package replacement. Updates from older updaters to this candidate therefore get the new reason without any change on their side. They only key onerror.code, which is unchanged.Why This Change Was Made
The reader child already sent
{ ok: false, message }, but the parent'sfinish()discarded it, and the async path reduced spawn errors to a boolean. The parent now reports the child's error or the exit facts. Whitespace and control characters (including ANSI escapes) are collapsed, and truncation adds…. Async timeouts are reported as timeouts rather than as a bare SIGKILL. The severity fix from #165539 is untouched.Changing the generated alias body would have broken release provenance for the shipped 2026.10.5-beta.1 alias, which was recognized only by exact match. Its normalized hash is added to the historical list, with the real installed 2026.10.5-beta.1
io.runtime.jsas the fixture. The 2026.9.8 provenance test is parametrized to cover both releases. Every release tag since 2026.9.5 maps to one of the three listed hashes: 9.5 and 9.6 to the first, 9.7 through 10.1 to the second, and 10.5-beta.1 to the new one.Evidence
Real update proof: published updater × this candidate
Author run, full
openclaw updatewith service activation, at head7df13cb7722(the generator is unchanged through3b727508e4f). I ran the repository's published-driver Docker cell (scripts/e2e/published-driver-update-docker.sh) locally. It installs the published[email protected]updater, starts a managed Gateway through the systemd shim with synthetic durable and incognito sessions, runsopenclaw update --tag <candidate.tgz> --yes --json, and then checks the run record, readyz, running version, and session data.Uninjected first: published 2026.10.1 updated to this candidate (
7df13cb7722, relabeled 2026.10.1 by the cell) and passed in 496 s. An earlier attempt on a host busy with three package builds failed: the service shim reported the previous Gateway as stopped and Doctor could not enter maintenance. A rerun in a fresh artifact directory passed, and hostedmainCI passes the same lane. I did not investigate it further.Fault injection: I made a copy of each candidate tgz whose alias target (
dist/io.runtime-<hash>.mjs) starts with a guard. The guard runs only inside the reader child (OPENCLAW_CONFIG_READ_CHILD=1) and only when the parent is notupdate-migrated-finalize.worker.js. It writessynthetic-config-secret=proof-secret-value-0000to stderr and exits 7. The content inventory hash is re-stamped so the package still passes admission. Each run triggered it exactly once, on the service-definition read during therestartingphase (the read from #169261). The finalize worker's other three reads ran normally.Updater log line from each run (
/tmp/openclaw/openclaw-2026-10-12.log, WARN):Both injected runs:
status: "ok". The recorded run isfinished/succeeded, readyz returns 200, the running version is verified, the managed service PID was replaced, durable session history is intact, incognito content is gone, and the seeded credentials sidecar is byte-identical.synthetic-config-secrethas 0 hits in update stdout, update stderr, the OpenClaw logs, and every other cell artifact.PATHline the managed reinstall writes on every update.I first tried injecting through a
NODE_OPTIONSpreload with both the published 2026.10.1 updater and 2026.10.1-beta.2 (the updater in #169261). Both updates passed, but the preload never reached the reader: only the first five updater processes loaded it, and later children started without it. That is why the guard lives in the candidate module.Unit tests and maintainer verification
test/scripts/update-config-runtime-compat.test.tsruns the real generated alias in child processes:Error [ERR_MODULE_NOT_FOUND]: Cannot find module '<root>/node_modules/handoff-dependency/advanced.js' imported from <root>/dist/io.runtime-Candidate.mjs.reader process exited with code 7 without a resultand that nothing reaches the parent's stderr.Fails before the fix: both behavior tests fail against the original generator.
Passes after:
test/scripts/update-config-runtime-compat.test.tsandtest/scripts/runtime-postbuild.test.ts, 146/146.pnpm test test/scripts/update-config-runtime-compat.test.ts --maxWorkers=1took 8 s wall; the new test takes about 170 ms.node scripts/check-changed.mjs(scripts, test-root, docs, and tooling lanes) passed every step, includingtypecheck scripts, except one test-root type error in the new provenance test. After fixing it,pnpm tsgo:test:rootpasses in all four shards.An independent read-only review confirmed Node 24.16 and Bun 1.4.2 report the same result shapes for timeout, buffer overflow, spawn failure, and signal. I applied its timeout, control-character, truncation-marker, and wording findings.
Published-driver × candidate cell (maintainer run, macOS, Node 26.9.0, isolated HOME/state). Driver: the published
[email protected]npm package (itsdist/io.runtime.jsis byte-identical to the new fixture). The driver loads its updater module (gateway-service-probe-hosts, which reads candidate config after package replacement), then the candidatedist/io.runtime.jsis written in place and the candidate'sjson5dependency is made unavailable. "After" uses the alias generated by this PR'swriteStableRootRuntimeAliasesover the same beta.1 dist.The published driver still sees
error.code === "candidate-config-read-failed"and falls back as before; only the message gains the reason. Not covered: a fullopenclaw updaterun with service activation.Maintainer rerun on
origin/mainmerged with this head:pnpm test test/scripts/update-config-runtime-compat.test.ts --maxWorkers=13/3 (6 s wall),pnpm test test/scripts/runtime-postbuild.test.ts --maxWorkers=1143/143 (24 s wall); with the original generator restored, the two behavior tests fail. Changed-file lint is clean (remainingpnpm linterrors aremax-linesin untouched files on current main). Autoreview (Codex, P0–P2): scoped-clean.Heads
dd227f9b3d8and3b727508e4fchange onlytest/scripts/runtime-postbuild.test.ts. They add an explicit comparator for CIcheck-lint(require-array-sort-compare) and keep the extracted names typed asstring[]for CIcheck-test-types-core-3(TS18048). Generator code is unchanged since7df13cb7722, so the cell above still applies. Locally, the CI changed-lint step passes,pnpm tsgo:test:rootpasses all four shards (55 s), andruntime-postbuild.test.tspasses 143/143.Inherited CI failure:
checks-node-compact-small-6failstest/scripts/eager-import-closure.test.ts > resolves wrapper package exports and workspace aliases…(src/chat/sender-identity.ts, …). Scheduled main CI run 38193977980 at9b5ac996870fails the same assertion (job 114632680489). This PR does not touch those files.Gaps:
openclaw updatewith service activation: covered by the real update proof above.