Repository navigation
fix(update): avoid ancestor package failures and repeated retries - #163541
Conversation
Treat undeclared ancestor-only plugin packages as unavailable during candidate inspection while preserving containment for declared dependencies and private symlink escapes. Use existing update-run history to pause repeated automatic candidate Doctor failures until the target changes or an operator retries manually. Add published-driver rehearsal and durable retry-admission regressions, and document the warning and recovery path. Fixes #163486. Thanks @iJaack for the diagnosis and reproduction.
|
🦞👀 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: blocked before merge. Reviewed October 2, 2026, 9:18 AM ET / 13:18 UTC. ClawSweeper reviewWhat this changesThe PR isolates undeclared ancestor package lookups during update rehearsal and pauses automatic retries after two matching candidate Doctor failures. Merge readiness⛔ Blocked before merge - 1 item remains This PR remains necessary: current main and the latest release retain the reported ancestor-lookup failure. The introduced changes preserve containment checks, and no actionable patch defect was found. Priority: P0 Review scores
Verification
How this fits togetherOpenClaw rehearses updates against a private copy before replacing the running installation. Plugin dependency inspection validates that copy, while the automatic update scheduler uses recorded outcomes to decide whether another attempt should start. flowchart TD
A[Update candidate] --> B[Private rehearsal copy]
B --> C[Plugin dependency inspection]
C --> D[Containment checks]
D --> E[Candidate Doctor result]
E --> F[Update history]
F --> G[Automatic retry admission]
G --> B
G --> H[Pause with recovery guidance]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +126, Tests +169, Docs +8. Total +303 across 9 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep rehearsal lookup isolated from unrelated ancestor packages while preserving escape rejection and durable, recoverable retry suppression. Do we have a high-confidence way to reproduce the issue? Yes at source level: an undeclared package found in ancestor node_modules enters the rehearsal graph and fails containment on current main. The PR supplies focused regressions; this review did not execute the failure. Is this the best way to solve the issue? Yes: the patch repairs dependency acquisition at its existing resolver and derives retry suppression from existing history, preserving ordinary resolution and containment enforcement. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against fc17c21ad7d4. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Landed (squash |
…hearsal copy and pause repeated auto-update failures (openclaw#163541) The candidate rehearsal copy lives under the service TMPDIR (for example ~/.openclaw/tmp), so Node module lookup from inside the copy walks up to the home directory; bundled playwright-core requires an undeclared optional chromium-bidi, which resolved from a home-level node_modules and made the outside-copy containment assertion fail the candidate Doctor on every 2026.9.6 to 9.7 attempt. The dependency scan now classifies an undeclared package that resolves only through an ancestor directory as unresolvable inside the temporary update copy (a warning before source capture); declared dependencies that resolve outside the copy and symlink escapes keep the fatal assertion. Auto-update admission pauses after two matching candidate Doctor failures for the same candidate using the existing SQLite update-run records, with a warning that states the recovery steps; a changed candidate or a manual openclaw update clears the pause. Thanks @iJaack for the diagnosis. Closes openclaw#163486
Closes #163486
What Problem This Solves
Fixes candidate Doctor failures when unrelated packages in an ancestor
node_modulesturn a vendor's undeclared optional import into an outside-copy dependency, followed by repeated expensive automatic update rehearsals.User Impact
Updates warn and continue for these undeclared ancestor lookups. Declared dependencies and private symlink escapes retain the existing fatal containment check. After two matching automatic candidate Doctor failures, further automatic rehearsals pause until the candidate changes or an operator runs
openclaw update.Why This Change Was Made
Node searches ancestor
node_modulesdirectories up to the filesystem root, so changing TMPDIR alone cannot guarantee isolation. This uses mechanism (b): the existing dependency resolver classifies undeclared packages found only outside the rehearsal as unresolvable before acquiring their source. The candidate rehearsal supplies that boundary; ordinary plugin resolution keeps its existing behavior. The existingassertPrivatecontainment check remains intact, including checks for declared dependencies, optional/peer declarations, and symlink escapes.Automatic campaign admission reads the last two non-preview update-run records through the existing SQLite reader worker. Matching candidate, reason, and failed-check signatures provide the durable backoff fact without a schema or sidecar. Temporary rehearsal suffixes and elapsed timings do not change the signature. Suppression happens before a new update run or service handoff; the warning includes the recovery command. Manual runs and changed candidates break the matching pair. Unavailable history warns and leaves normal update admission available.
The candidate-side fix recognizes the rehearsal contract already shipped in 2026.9.6. The retry backoff requires a Gateway running the repaired scheduler. Troubleshooting documents both messages. Thanks @iJaack for the diagnosis and reproduction.
Evidence
v2026.9.6rehearsal path markers are byte-identical to the fixture helper, and its Doctor flags match. Tests cover undeclared ancestor packages, all three dependency declaration kinds, private dependency preference, and existing symlink-escape rejection. Invalid ancestor JavaScript is never parsed.node scripts/run-vitest.mjs <importers> --maxWorkers=1, 378.92s runner wall time, including the required build (42.3s). The existing managed-service lifecycle file accounted for 104.46s of test time. After removing a redundant capture-path alias to stay within the existing 700-line cap, the capture and rehearsal owners passed again: 96/96 tests in 27.75s.src/infra/update-candidate-plugin-repair.test.tspassed 33/33 in 13.02s wall;src/infra/update-startup-campaign-run.test.tspassed 16/16 in 50.70s wall (including preparation).node scripts/check-changed.mjs --base 7a62f6ec184f2e2c9dbb7ddd6cc1a848e359531bpassed all selected gates, including core and 27 test typecheck graphs, lint, all unused-export scans, and structural guards. Initial line-cap growth, fixture indexing, and lint findings were corrected without suppressions or baseline edits.scoped-clean, no actionable findings.git diff --checkpasses.Validation ran locally on macOS arm64, Node 26.10.0, with isolated fixtures; no live operator Gateway was used. This proves the published-driver rehearsal boundary, not a full installed-version upgrade. CI timing is pending at authoring handoff; auto-merge is disabled.