Repository navigation
fix: failed-update triage misses agents on the operator's PATH - #194058
roboclaw-bot merged 1 commit into
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 real behavior proof before merge. What this changesThis PR captures the invoking operator's environment before managed update admission and passes it to the existing failed-update triage owner. Example: On macOS, Codex is installed in ~/.local/bin, which appears in the operator's PATH but not the Gateway service's PATH.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep open: current main still captures the managed-service environment as the operator environment, and this PR provides a focused repair with no actionable code findings. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe update CLI prepares a failure handler during admission; after update cleanup, that handler combines the operator environment with the selected Gateway installation's state paths and invokes interactive triage. flowchart TD
A[Operator invokes update] --> B[Capture operator environment]
B --> C[Managed candidate admission]
C --> D[Failure and cleanup]
D --> E[Project target selectors]
E --> F[Triage launch confirmation]
F --> G[Operator coding agent]
Technical reviewBest possible solution: Capture the operator environment before managed admission and reuse the existing triage projection, cleanup and consent owners, as this patch does. Do we have a high-confidence way to reproduce the issue? Source confirms that candidate admission registers the failure handler under the service environment and current main snapshots that environment; the contributor reports base failures and passing native-subprocess regressions, which were inspected but not executed during this read-only review. Is this the best way to solve the issue? This is the smallest complete repair: preserve operator identity before the scope changes, then let the existing triage owner combine it with current target selectors. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 82699babf3e2. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +7, Tests +79, Docs +8, Other +2. Total +96 across 6 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
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 November 6, 2026, 4:40 AM ET / 09:40 UTC. |
|
Thanks @TheRealUnknownSoldier for the fix. Here is the real behavior proof the review asked for. Shipped-CLI behavior proof for
Terminal excerpts: This proves Linux CLI discovery and consent with a process-recording fixture, plus latest-stable package replacement and config preservation. It does not claim a real Codex/model repair or native macOS coverage. |
|
@clawsweeper re-review Updated the PR body with real packaged-CLI macOS proof for unchanged head
The body also links the separate Linux/systemd candidate-admission proof posted by roboclaw-bot. Limits are explicit: the macOS failure was a real missing-package ENOENT, and actual Codex launches stopped at the unauthenticated welcome screen. This does not claim to repair the original SQLite timeout or execute a model request. |
|
ClawSweeper could not start a re-review for this item. |
…aw#194058) Failed-update triage now captures the operator's environment before managed candidate admission, so a coding agent installed only on the operator's PATH is still offered when the Gateway service's PATH differs. Restores the operator-environment contract from openclaw#134490 and keeps the launch confirmation from openclaw#143139. Proof: shipped CLI on isolated Linux (Crabbox) with a running systemd Gateway: accept launches the operator-only agent, decline starts nothing, base ba59f83 reports no agent found; published 2026.11.1 upgrades to the fix with settings intact. Co-authored-by: TorstenW <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: steipete <[email protected]>
…aw#194058) Failed-update triage now captures the operator's environment before managed candidate admission, so a coding agent installed only on the operator's PATH is still offered when the Gateway service's PATH differs. Restores the operator-environment contract from openclaw#134490 and keeps the launch confirmation from openclaw#143139. Proof: shipped CLI on isolated Linux (Crabbox) with a running systemd Gateway: accept launches the operator-only agent, decline starts nothing, base 18bee8e reports no agent found; published 2026.11.1 upgrades to the fix with settings intact. Co-authored-by: TorstenW <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: steipete <[email protected]> (cherry picked from commit 7c702c3) Release adaptation: Capture invoking operator env before candidate admission, forward to interactive triage only; preserve latest target selectors, confirmation and lease cleanup ordering. Exact three authorized production paths plus real lifecycle regression. Follow-up dispositions: ad4863d fix: preserve the running installation when an agent updates its Gateway (openclaw#201570); dc73ec0 fix: let updates finish when another tool briefly reads OpenClaw's databases (openclaw#202541); d07b530 fix: clarify PostgreSQL schema upgrades for Git installs (openclaw#202098); e60ea9f test(update): add a Git release upgrade-survivor scenario (openclaw#201956); 2ef6f7b fix(update): build and serve Git releases outside node_modules (openclaw#201917); dbc1aa0 fix: keep the openclaw command and Gateway working after updating a pnpm install (openclaw#201735); f5e7641 fix: Git checkout updates across a schema change no longer end as post-update-failed after the new release starts (openclaw#201600); 2183caf fix: Git checkout updates no longer fail before the new release starts on a schema change or a busy database (openclaw#201463); 47e8649 fix: explain why Doctor cannot restore a scheduled job’s account (openclaw#201550); 8f2cfd4 fix: remove updater-only restrictions from agent maintenance guidance; cb5cfb2 fix: keep a doubtful killed-update recovery on the repair path (openclaw#201361); 24cb734 fix: keep carried-over scheduled jobs running after updates (openclaw#200653); d1276e1 feat(doctor): check OpenClaw ID member roles and honor an optional roles default (openclaw#197785); 0a39956 fix: finish updates when another tool reads OpenClaw's databases during the update (openclaw#201330); ea1c9d5 fix(update): settle remounted package publications before admission (openclaw#201336); 66b5212 fix(update): isolate malformed retained-install markers (openclaw#201199); 7e79c83 fix: let the next update finish a killed source checkout update (openclaw#201009); d905d8a fix: let the next update finish a killed update after the machine restarted (openclaw#200994); fdf0c95 fix: let the next update finish a killed update that had already installed the new version (openclaw#200866); 0c19bcd chore(release): close out 2026.11.5 on main (openclaw#200577); a1940e0 fix(matrix): keep explicit recovery available during deferred migration (openclaw#200805); 18b4776 improve: explain package baseline drift during updates (openclaw#200802); 1ad4cad fix(doctor): reclaim macOS updater runtimes blocked by non-updater processes (openclaw#200732); 427c857 fix: keep one missing archived transcript from blocking every update (openclaw#200733); 802e3f7 fix(update): keep valid cold archives from blocking updates (openclaw#200659); 23fca1a fix: let the next update continue after a killed update when nothing is left to repair (openclaw#200680); 3afe212 fix: let Doctor publish unchanged plugin migrations in any order (openclaw#200658); f65e4db fix(doctor): reclaim runtimes blocked by unrelated Linux processes (openclaw#200657); dab086c fix(update): let candidate Doctor read plugin dependencies from the staged package (openclaw#200595); 3447bee fix(update): keep updates going when the predecessor writes during its stop (openclaw#200569); 0ce9c77 fix: let the next update settle a package publication that a killed update left behind (openclaw#200550); ae31ea3 fix(update): repair handoffs in the journal-pinned lease store (openclaw#200532); 74020ea fix: continue updates when initial SQLite capture is stale (openclaw#200328); 6747b1e feat(update): run Git checkout installs from releases behind the release link (openclaw#199706); e3f8a67 fix(state): keep completed retained agent stores out of startup upgrade (openclaw#200284); 3c512c5 fix(gateway): move managed update lease operations off the main thread (openclaw#200169); ea69fcb chore(release): close out 2026.11.4 on main (openclaw#199956); 618bf31 fix(state): bound startup upgrade copies and pruning to owned state (openclaw#199929); e4a3093 perf(update): replace the candidate canary with a runtime contract check (openclaw#198268); 5dbf569 fix(update): plugin failures never fail an update or Gateway health; 764761e fix(update): refuse missing host prerequisites in one line and record a cause per attempt; 4c4fef4 fix(ui): update dialog claims installation before progress is confirmed (openclaw#199254); 136e1f6 fix(update): retrying an update from a dev checkout is refused after a killed update (openclaw#198673); 3bd03da fix(update): avoid duplicate database copies while the Gateway is stopped (openclaw#198148); 68a839b fix: isolate held agent databases until explicit restoration (openclaw#198180); e333f7e chore(ci): drop retired test-lines allocation records (3/3) (openclaw#197657); fd6fa47 fix: converge Gateway updates with environment-only service overrides (openclaw#196371); 7cf5e75 fix: clarify split-install updates and blocked Doctor repairs (openclaw#196342); 6ff8c86 fix(update): retain lazy sqlite catalog generation (openclaw#197095); 930e1f7 fix: keep stable updates and recovery free of premature migrations (openclaw#196474); a15f737 fix: preserve external plugin data during update rehearsal (openclaw#196301); 92798ae fix: updates survive interrupted heartbeat runs (openclaw#195656); c1e55e2 fix(update): restore LaunchAgent registration after repair contention (openclaw#195406); 715c610 fix(doctor): repair retained ISO session end timestamps (openclaw#194685); 689cfc8 fix(update): reclaim dead closing triage repair leases (openclaw#194503); 86bc89e fix(doctor): keep standing Codex parameter advice out of retirement blockers (openclaw#193650); 691bc8d fix(backup): read the backup engine without copying the live database (openclaw#194234); 000542f fix(backup): backups and updates fail on slow storage when a header probe batch misses its deadline (openclaw#194239); 31a65d5 fix(update): skip --no-lazy-fetch on Git versions without it (openclaw#194198); e45e99d fix(update): preserve dev update sources in tag-only Git clones (openclaw#193109) Validation: Baseline2 intended operator-agent failures/32 controls passed; candidate34/34passed (194058-green.log). Accept launches synthetic operator-only CLI with expected env, decline starts nothing. Isolated updater flow, not live systemd/upgrade qualification. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 6689fd575ada8fe40a9593784deac18ec73041cd) (cherry picked from commit 92e7a9fa223b0dc35801f25f70be90b472d9a6b7)
What Problem This Solves
Fixes failed-update triage reporting that no coding-agent CLI is on
PATHwhen candidate admission uses a managed Gateway environment that excludes the invoking operator's agent directory.Reported on macOS with Codex available in the operator's
~/.local/binbut absent from the Gateway service'sPATH.User Impact
Operators can start their installed repair agent after selecting Diagnose update failure and confirming the launch, using their original environment and the target installation's state paths.
The installed updater must contain this fix; downloading a newer candidate cannot repair the older updater's captured context. This does not fix the separate SQLite backup-worker timeout that triggered the reported failed update. No configuration or schema migration is required.
Why This Change Was Made
initializeAndRunUpdateregisters the admitted run insidewithOwnedManagedUpdateEnv. Triage preparation previously capturedprocess.envthere, so the service environment was saved as the operator environment even after the scope unwound.Capture the operator snapshot before entering those scopes and pass it through the existing triage preparation owner. The existing target-selector projection, cleanup ordering, confirmation, and unattended diagnostics remain in place. Other callers retain their current capture behavior.
Evidence
Packaged CLI behavior, macOS — November 6, 2026
Addressing the ClawSweeper proof request on unchanged head
b700adc50efe87577755dee968e11548f2700f6c.Ran the installed
openclaw.mjsCLI from normal npm package installations on macOS 27.2 arm64, Node 24.22.2, with two canonical named profiles, distinct npm prefixes, real launchd Gateway services, separate loopback ports, and synthetic state. No service-selection, admission, confirmation, discovery, or spawn functions were mocked. A Python PTY recorder only launched the CLI and copied terminal bytes; consent was entered at the real prompts.The failure trigger was a deliberately absent local tarball passed to
update --tag file:...: real npm returnedENOENTafter update-run admission, before activation. This exercises managed-environment registration and the resulting failure handoff without inducing database damage. It is not a reproduction or repair of the original SQLite backup-worker timeout.2026.11.1 (4ffdd20)2026.11.1 (b700adc), fresh profileNo repair agent was started.and a manual command; no Codex startup output.openclaw updateNo repair agent was started.and manual command.meta/wizardmetadata.Codex was a symlink to the real installed native binary, not a process-recording fixture. Its isolated
CODEX_HOMEused file credentials and had no login. Both accepted launches were deliberately stopped with Ctrl-C at the welcome/sign-in screen: this proves discovery, consent and native launch, not an authenticated model request or successful repair. The intentional failed-update commands returned exit 1; the real upgrade returned exit 0.Package identity, setup and commands
Built the pinned, clean source tree with
pnpm build:package(exit 0; 5m30.4s), then the canonical package helper:The local native pnpm bootstrap returned
ENOEXEC, so build/pack used the same pinned pnpm 12.15.0 JavaScript entrypoint.--skip-buildreused the completed full package build. Package inventory, bundled dependency and dist import-graph validation passed.Separate prefixes were populated with
npm install --global --prefix "$PREFIX" [email protected](upgrade scenario) and the PR tarball (fresh scenario). The registry'slatesttag was2026.11.1. Each invocation explicitly selected its canonical named-profile state/config/workspace and isolatedCODEX_HOME; the OS account HOME was required by native service ownership checks. Gateway installation used:The services had separate names ending
triage-proof-194058-te14-freshandtriage-proof-194058-te14-upgrade. Both temporary services were stopped and uninstalled after testing; launchd labels were absent, ports were closed, and no task runtime remained. The normal operator Gateway was not modified. The launcher env was built from explicit test values rather than copied production credentials.PATH separation and real Codex child environment
Read the generated service env files and resolved the executable against each PATH:
Native child observations after approval (selected non-secret environment keys only):
Redacted terminal excerpts — baseline, fresh and upgraded profiles
ANSI controls/progress animations are removed; package-install repetition and unrelated diagnostics are omitted. Paths use placeholders. These are excerpts from the real CLI captures.
Published stable, before upgrade:
Fresh profile: declined:
Fresh profile: accepted:
The subsequent native TUI displayed
OpenAI Codex (v0.165.0),Welcome, andSign in with ChatGPT; Ctrl-C ended the proof before login.Upgraded profile: declined:
Upgraded profile: accepted:
The subsequent native TUI displayed
OpenAI Codex (v0.165.0),Welcome, andSign in with ChatGPT; Ctrl-C ended the proof before login.Latest-stable update, readiness and preserved settings
Independent post-update
health --jsonreturnedok: true,coreReady: true, andmodelRuntime.degraded: false. The update had advisory warnings (including the intentionally disabled plugins/no provider credentials and the original live-state capture being unsealed); pre-migration snapshots and all activation/readiness checks completed. This is not a claim of warning-free Doctor output.Settings comparison against the values supplied before installation:
A separate Linux/systemd proof report was also posted by
roboclaw-bot: it reports a real candidate-owned invalid-config admission refusal, both consent branches, a latest-stable upgrade and a base-code RED control. That lane used a recording agent fixture; the macOS lane above used the actual Codex binary. The Linux results are attributed to that report, not claimed as a second local execution.Automated regression and static evidence
18bee8e4252aa40d375531ff608edfd7225cb237, both new cases fail and print the reportedNo supported coding-agent CLI executable was found on this process's PATH.message.updateCommand, initialization, admission registration, unwind, executable discovery, and native subprocess launch. Accepting consent writes a receipt proving operatorPATH/HOME/CODEX_HOME, target selectors, the original failure prompt, and removal of update markers. Declining consent creates no receipt. Confirmation observes the released executor lease.--mode local --no-web-search) on the final staged diff against18bee8e4252aa40d375531ff608edfd7225cb237returned no actionable findings. Its earlier test-fixture type finding was corrected and the affected checks rerun.Reproduction commands, test cost, and proof limits
Local macOS proof used the repository-pinned pnpm 12.15.0 and test runtime. The full three-suite run took 168.11 seconds; the existing initializer suite took 109.99 seconds, with 8.07 seconds in the two added cases. A final focused rerun after a fixture-only type annotation passed in 17.63 seconds wall time. Current-head CI has no failing checks (73 successful checks; the remaining results are skipped, cancelled, or neutral).
The test supplies an isolated service environment and injects failure immediately after real admission. It uses a temporary executable named
codex, not a real account or provider request. Package metadata and service selection use the existing suite fixtures. It proves the environment-capture handoff, not a live package replacement or repair of the original backup failure. The POSIX executable fixture is skipped on Windows.Author simplification/test audit: +7 net production lines and +79 test lines. The existing triage owner is reused; no new resolver, fallback, or configuration option. The dedicated 79-line allocation covers one missing integration boundary plus the consent-negative control; helper-only tests previously captured the environment before manually entering the service scope and missed this ordering bug.