Skip to content

fix: failed-update triage misses agents on the operator's PATH - #194058

Merged
roboclaw-bot merged 1 commit into
openclaw:mainfrom
TheRealUnknownSoldier:codex/update-triage-operator-env
Nov 6, 2026
Merged

roboclaw-bot merged 1 commit into
openclaw:mainfrom
TheRealUnknownSoldier:codex/update-triage-operator-env

Conversation

@TheRealUnknownSoldier

@TheRealUnknownSoldier TheRealUnknownSoldier commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes failed-update triage reporting that no coding-agent CLI is on PATH when 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/bin but absent from the Gateway service's PATH.

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

initializeAndRunUpdate registers the admitted run inside withOwnedManagedUpdateEnv. Triage preparation previously captured process.env there, 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.mjs CLI 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 returned ENOENT after 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.

Installed CLI / profile Action and observed outcome
Published latest stable 2026.11.1 (4ffdd20) Real managed update failed; Diagnose update failure incorrectly reported no coding-agent CLI although the operator PATH resolved Codex.
Packaged PR 2026.11.1 (b700adc), fresh profile Yes: detected Codex and launched actual Codex 0.165.0 to its welcome/sign-in screen; observed native child PID 30540 of updater PID 29898.
Same fresh profile No: printed No repair agent was started. and a manual command; no Codex startup output.
Published stable → packaged PR through real openclaw update Exit 0; actual package activation, database snapshot, Doctor, service restart and readiness verification completed. Before/after build identities differ despite the same version number.
Upgraded profile Yes: actual Codex welcome/sign-in screen, child PID 31926 of updater PID 31581. No: No repair agent was started. and manual command.
Settings preservation Both profiles retained all 10 supplied config leaf values, including synthetic Gateway auth, port/bind, workspace, logging and plugin settings, plus the workspace marker file. Upgrade added normal meta/wizard metadata.

Codex was a symlink to the real installed native binary, not a process-recording fixture. Its isolated CODEX_HOME used 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:

node scripts/package-openclaw-for-docker.mjs --skip-build --allow-unreleased-changelog \
  --output-dir "$PROOF_ROOT/artifacts" --output-name openclaw-pr-194058.tgz \
  --pack-json "$PROOF_ROOT/artifacts/pack.json"

The local native pnpm bootstrap returned ENOEXEC, so build/pack used the same pinned pnpm 12.15.0 JavaScript entrypoint. --skip-build reused the completed full package build. Package inventory, bundled dependency and dist import-graph validation passed.

OpenClaw package tarball integrity passed.
SHA-256 openclaw-pr-194058.tgz:
70656d58d68cb98044b3706a097f1673de135860e0f28723575754090c72f78b
Published CLI: OpenClaw 2026.11.1 (4ffdd20)
Fresh installed PR CLI: OpenClaw 2026.11.1 (b700adc)
Upgraded CLI: OpenClaw 2026.11.1 (b700adc)
Agent: codex-cli 0.165.0

Separate prefixes were populated with npm install --global --prefix "$PREFIX" [email protected] (upgrade scenario) and the PR tarball (fresh scenario). The registry's latest tag was 2026.11.1. Each invocation explicitly selected its canonical named-profile state/config/workspace and isolated CODEX_HOME; the OS account HOME was required by native service ownership checks. Gateway installation used:

node "$PREFIX/lib/node_modules/openclaw/openclaw.mjs" gateway install \
  --runtime node --runtime-path /opt/homebrew/opt/node@24/bin/node --port "$FREE_PORT" --json
node "$PREFIX/lib/node_modules/openclaw/openclaw.mjs" health --json

# Real failure, repeated with Yes and No at the triage confirmation.
node "$PREFIX/lib/node_modules/openclaw/openclaw.mjs" update \
  --tag "file:$PROOF_ROOT/artifacts/missing-openclaw.tgz"

# Successful upgrade from published stable to the PR artifact.
node "$UPGRADE_PREFIX/lib/node_modules/openclaw/openclaw.mjs" update \
  --tag "file:$PROOF_ROOT/artifacts/openclaw-pr-194058.tgz" --yes

The services had separate names ending triage-proof-194058-te14-fresh and triage-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:

{
  "fresh": {
    "operatorCodex": "$PROOF_ROOT/operator-bin/codex",
    "serviceCodex": null,
    "servicePath": "/opt/homebrew/opt/node@24/bin:$PROOF_ROOT/fresh-home/npm/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
  },
  "upgrade": {
    "operatorCodex": "$PROOF_ROOT/operator-bin/codex",
    "serviceCodex": null,
    "servicePath": "/opt/homebrew/opt/node@24/bin:$PROOF_ROOT/upgrade-home/npm/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
  }
}

Native child observations after approval (selected non-secret environment keys only):

[
  {
    "pid": 30540,
    "parentPid": 29898,
    "executable": "$PROOF_ROOT/operator-bin/codex",
    "selectedEnv": {
      "HOME": "$ACCOUNT_HOME",
      "PATH": "/opt/homebrew/Cellar/node@24/24.22.2_2/bin:/usr/bin:/bin:$PROOF_ROOT/operator-bin:$PROOF_ROOT/fresh-home/npm/bin:/opt/homebrew/opt/node@24/bin:/usr/sbin:/sbin:/opt/homebrew/bin:/usr/local/bin:$ACCOUNT_HOME/Library/pnpm:$ACCOUNT_HOME/.local/bin",
      "CODEX_HOME": "$PROOF_ROOT/fresh-home/.codex",
      "OPENCLAW_PROFILE": "triage-proof-194058-te14-fresh",
      "OPENCLAW_STATE_DIR": "$FRESH_STATE_DIR",
      "OPENCLAW_CONFIG_PATH": "$FRESH_STATE_DIR/openclaw.json",
      "OPENCLAW_WORKSPACE_DIR": "$PROOF_ROOT/fresh-home/workspace"
    }
  }
]
[
  {
    "pid": 31926,
    "parentPid": 31581,
    "executable": "$PROOF_ROOT/operator-bin/codex",
    "selectedEnv": {
      "HOME": "$ACCOUNT_HOME",
      "PATH": "/opt/homebrew/Cellar/node@24/24.22.2_2/bin:/usr/bin:/bin:$PROOF_ROOT/operator-bin:$PROOF_ROOT/upgrade-home/npm/bin:/opt/homebrew/opt/node@24/bin:/usr/sbin:/sbin:/opt/homebrew/bin:/usr/local/bin:$ACCOUNT_HOME/Library/pnpm:$ACCOUNT_HOME/.local/bin",
      "CODEX_HOME": "$PROOF_ROOT/upgrade-home/.codex",
      "OPENCLAW_PROFILE": "triage-proof-194058-te14-upgrade",
      "OPENCLAW_STATE_DIR": "$UPGRADE_STATE_DIR",
      "OPENCLAW_CONFIG_PATH": "$UPGRADE_STATE_DIR/openclaw.json",
      "OPENCLAW_WORKSPACE_DIR": "$PROOF_ROOT/upgrade-home/workspace"
    }
  }
]
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:

⚠️ OpenClaw update failed: global-install-failed.
Failing check npm (ENOENT)
Update failed. Entering triage...
Debugging prompt: $UPGRADE_STATE_DIR/logs/support/openclaw-triage-prompt-2026-11-06T10-27-56-731Z-27601.md
No supported coding-agent CLI executable was found on this process's PATH.
If already installed, add its executable to this shell's PATH; otherwise install a supported coding-agent CLI, then run triage again.
You can also open the saved debugging prompt in an agent you already use.
Next step:
  env OPENCLAW_STATE_DIR='$UPGRADE_STATE_DIR' OPENCLAW_CONFIG_PATH='$UPGRADE_STATE_DIR/openclaw.json' OPENCLAW_WORKSPACE_DIR='$PROOF_ROOT/upgrade-home/workspace' openclaw --profile triage-proof-194058-te14-upgrade triage --update-result $UPGRADE_STATE_DIR/logs/support/openclaw-update-failure-33b55f98_7980_45aa_95ce_f01e8350aa3e.json
No coding agent can be launched directly; follow the next step above.

Fresh profile: declined:

Update failed. Entering triage...
Agent: codex. This will use your own account/tokens.
Debugging prompt: $FRESH_STATE_DIR/logs/support/openclaw-triage-prompt-2026-11-06T10-31-20-052Z-29003.md
│
◆  Open codex to diagnose and repair the installation now? [y/N]
│  ○ Yes / ● No
└

◇  Open codex to diagnose and repair the installation now? [y/N]
│  No
No repair agent was started.
Next step (codex detected):
  env OPENCLAW_STATE_DIR='$FRESH_STATE_DIR' OPENCLAW_CONFIG_PATH='$FRESH_STATE_DIR/openclaw.json' OPENCLAW_WORKSPACE_DIR='$PROOF_ROOT/fresh-home/workspace' codex exec --skip-git-repo-check - < '$FRESH_STATE_DIR/logs/support/openclaw-triage-prompt-2026-11-06T10-31-20-052Z-29003.md'

Fresh profile: accepted:

Update failed. Entering triage...
Agent: codex. This will use your own account/tokens.
Debugging prompt: $FRESH_STATE_DIR/logs/support/openclaw-triage-prompt-2026-11-06T10-32-05-261Z-29898.md
│
◆  Open codex to diagnose and repair the installation now? [y/N]
│  ○ Yes / ● No
└

◇  Open codex to diagnose and repair the installation now? [y/N]
│  Yes
Starting codex; use --agent <name> to select another coding agent.

The subsequent native TUI displayed OpenAI Codex (v0.165.0), Welcome, and Sign in with ChatGPT; Ctrl-C ended the proof before login.

Upgraded profile: declined:

Update failed. Entering triage...
Agent: codex. This will use your own account/tokens.
Debugging prompt: $UPGRADE_STATE_DIR/logs/support/openclaw-triage-prompt-2026-11-06T10-34-29-421Z-31273.md
│
◆  Open codex to diagnose and repair the installation now? [y/N]
│  ○ Yes / ● No
└

◇  Open codex to diagnose and repair the installation now? [y/N]
│  No
No repair agent was started.
Next step (codex detected):
  env OPENCLAW_STATE_DIR='$UPGRADE_STATE_DIR' OPENCLAW_CONFIG_PATH='$UPGRADE_STATE_DIR/openclaw.json' OPENCLAW_WORKSPACE_DIR='$PROOF_ROOT/upgrade-home/workspace' codex exec --skip-git-repo-check - < '$UPGRADE_STATE_DIR/logs/support/openclaw-triage-prompt-2026-11-06T10-34-29-421Z-31273.md'

Upgraded profile: accepted:

Update failed. Entering triage...
Agent: codex. This will use your own account/tokens.
Debugging prompt: $UPGRADE_STATE_DIR/logs/support/openclaw-triage-prompt-2026-11-06T10-35-29-327Z-31581.md
│
◆  Open codex to diagnose and repair the installation now? [y/N]
│  ○ Yes / ● No
└

◇  Open codex to diagnose and repair the installation now? [y/N]
│  Yes
Starting codex; use --agent <name> to select another coding agent.

The subsequent native TUI displayed OpenAI Codex (v0.165.0), Welcome, and Sign in with ChatGPT; Ctrl-C ended the proof before login.

Latest-stable update, readiness and preserved settings
Phase: requested
  ✓ package-install (16.09s)
Phase: staging
Phase: validating
  ✓ candidate-state-snapshot (2.21s)
  ✓ candidate-config (1.14s)
  ✓ candidate-plugins (1.12s)
  ✓ candidate-recovery (1.05s)
  ✓ candidate-gateway-startup (4.68s)
Phase: activating
  ✓ database snapshot (2.71s)
Gateway: restarted and verified.
✅ OpenClaw updated to 2026.11.1 (from 2026.11.1); 11 warnings need attention.
Admission checks: config: ok, database-schema: ok, node-runtime: ok, plugin-availability: ok.
Phases: requested (20.16s) → staging (8ms) → validating (81.19s) → activating (84.85s) → restarting (4.61s) → verifying (16.73s)
Recorded verification: service running (2026.11.1); version verified; channels ready; HTTP ready; core ready.
Gateway downtime: 95.98s.

Independent post-update health --json returned ok: true, coreReady: true, and modelRuntime.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:

{
  "scenario": "fresh",
  "checks": {
    "gateway.mode": true,
    "gateway.port": true,
    "gateway.bind": true,
    "gateway.controlUi.enabled": true,
    "gateway.auth.mode": true,
    "gateway.auth.token": true,
    "agents.defaults.workspace": true,
    "logging.level": true,
    "plugins.enabled": true,
    "env.vars.TRIAGE_PROOF_MARKER": true,
    "workspace marker": true
  },
  "allPreserved": true,
  "addedTopLevelKeys": [],
  "workspaceSha256": "64910ea48c642d888b56fe8b56d833f5bdac902b688542ca8dabc6f25a76d962"
}
{
  "scenario": "upgrade",
  "checks": {
    "gateway.mode": true,
    "gateway.port": true,
    "gateway.bind": true,
    "gateway.controlUi.enabled": true,
    "gateway.auth.mode": true,
    "gateway.auth.token": true,
    "agents.defaults.workspace": true,
    "logging.level": true,
    "plugins.enabled": true,
    "env.vars.TRIAGE_PROOF_MARKER": true,
    "workspace marker": true
  },
  "allPreserved": true,
  "addedTopLevelKeys": [
    "meta",
    "wizard"
  ],
  "workspaceSha256": "64910ea48c642d888b56fe8b56d833f5bdac902b688542ca8dabc6f25a76d962"
}

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

  • Red on base: with the three production files restored to 18bee8e4252aa40d375531ff608edfd7225cb237, both new cases fail and print the reported No supported coding-agent CLI executable was found on this process's PATH. message.
  • Green with the fix: both cases pass through real updateCommand, initialization, admission registration, unwind, executable discovery, and native subprocess launch. Accepting consent writes a receipt proving operator PATH/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.
  • Surrounding coverage: all 56 tests across 3 suites pass, including late target-selector replacement, unusable state/cwd recovery, unattended diagnostics, and managed/post-core handling.
  • Static checks: update CLI TypeScript shard, scoped lint, changed-file formatting, diff whitespace, and test-line ratchet pass.
  • Independent review: Codex autoreview (--mode local --no-web-search) on the final staged diff against 18bee8e4252aa40d375531ff608edfd7225cb237 returned no actionable findings. Its earlier test-fixture type finding was corrected and the affected checks rerun.
Reproduction commands, test cost, and proof limits
# Fails on the base production code; passes with this fix.
pnpm test src/cli/update-cli/update-command-fresh-preview.test.ts --maxWorkers=1 -t "uses the operator's agent"

# Complete owner and adjacent recovery suites: 56 passed.
pnpm test src/cli/update-cli/update-command-fresh-preview.test.ts src/cli/update-cli/update-command-triage.test.ts src/infra/update-triage.test.ts --maxWorkers=1

node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.cli-update.json --incremental
node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/cli/update-cli/update-command-fresh-preview.test.ts src/cli/update-cli/update-command-initialization-run.ts src/cli/update-cli/update-command-triage.ts src/infra/update-triage.ts
node scripts/run-format.mts --check src/cli/update-cli/update-command-fresh-preview.test.ts src/cli/update-cli/update-command-initialization-run.ts src/cli/update-cli/update-command-triage.ts src/infra/update-triage.ts docs/install/updating.md
node --import ./scripts/tsx.mjs scripts/check-test-lines-ratchet.mts --base 18bee8e4252aa40d375531ff608edfd7225cb237

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.

@clawsweeper

clawsweeper Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes size: S labels Nov 6, 2026
@TheRealUnknownSoldier
TheRealUnknownSoldier marked this pull request as ready for review November 6, 2026 09:22
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 6, 2026
@clawsweeper

clawsweeper Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This 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.

  • Before: Selecting Diagnose update failure reports that no supported coding-agent executable was found.
  • After: Triage finds the operator's Codex installation and requests confirmation before launching it with the target installation's selectors.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The implementation is focused and source-correct; the overall rating reflects the external-PR behavior-proof gate.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An installed repair agent disappears from failed-update triage when the Gateway service's PATH differs from the invoking operator's PATH.
Reason: The patch restores the operator-environment contract established by #134490 while preserving the confirmation introduced by #143139.

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
Reviewed head: b700adc50efe87577755dee968e11548f2700f6c

Before merge

  • Add real behavior proof - The supplied macOS evidence exercises updateCommand in a test harness with mocked service selection, injected admission failure, mocked confirmation and a temporary codex executable; it does not show the shipped CLI running this scenario. The contributor should attach redacted terminal output, logs or a recording from an isolated updater containing the fix, showing managed admission failure, operator-only agent discovery, accepted launch and declined non-launch, plus fresh-profile and latest-stable upgrade coverage with settings intact; redact IPs, API keys, phone numbers and non-public endpoints. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.

Findings

None.

Tests

  • Missing end-to-end proof: Missing shipped-CLI evidence of the operator-only agent being discovered and launched after consent following managed admission failure, including a latest-stable upgrade with settings intact.
Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Interactive triage environment capture keeps the original intent (80ae248: Capture operator executables, authentication and working directory before package replacement while projecting the latest installation selectors after cleanup.)
  • Initialization-time triage preparation keeps the original intent (b107d4a: Keep recovery with existing lifecycle owners and prepare the admitted run's failure handler before replacement, invoking it only after staged cleanup and executor release.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned patch and current-main comparison: The introduced diff moves environment capture before managed scopes and forwards it through existing owners; the three affected production files on fetched main retain the merge-base behavior. (src/cli/update-cli/update-command-initialization-run.ts:96, b700adc50efe)
  • Existing operator-environment contract: The merged introduction explicitly assigns executables and authentication to the invoking operator and installation selectors to the latest target; this PR restores that contract rather than introducing another agent-selection policy. (src/infra/update-triage.ts:82, 80ae248de1c0)
  • Admission ordering provenance: Current-main blame attributes both preparation during run registration and the enclosing candidate managed-environment scope to the interrupted-package-update recovery change; that change retained staged cleanup and executor release before failure handling. (src/cli/update-cli/update-command-initialization-run.ts:195, b107d4af14d7)
  • Consent and final process effect: The existing triage owner returns on declined confirmation, checks currentness after confirmation and immediately before spawn, and passes the projected environment to the child; this patch changes none of those gates. (src/commands/triage.ts:424, b700adc50efe)
  • Regression coverage and disclosed limits: The added cases exercise real admission registration, unwind, executable discovery and native subprocess launch for accepted consent, plus absence of a subprocess receipt for declined consent; the full PR body explicitly identifies the executable as a fixture and supplies test results rather than a shipped-CLI capture. (src/cli/update-cli/update-command-fresh-preview.test.ts:654, b700adc50efe)
  • Policy and inspection limits: Read the complete root and applicable docs AGENTS files, simplification and test-audit guidance; no maintainer-notes directory exists. Some historical content searches reached unavailable promisor objects, while current source, relevant blame, commit metadata and original PR explanations were available. The checkout remains clean. (AGENTS.md:1, b700adc50efe)

Likely related people:

  • Peter Steinberger: Raw commit 80ae248 adds src/infra/update-triage.ts:67 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 80ae248de1c0; files: src/infra/update-triage.ts)
  • Vincent Koc: Raw commit 931de9e adds src/cli/update-cli/update-command-initialization-run.ts:514 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 931de9e55a35; files: src/cli/update-cli/update-command-initialization-run.ts)
  • Jason (Json): Raw commit 23643df adds src/cli/update-cli/update-command-triage.ts:68 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 23643dfb8830; files: src/cli/update-cli/update-command-triage.ts)

PR surface

Source +7, Tests +79, Docs +8, Other +2. Total +96 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 9 2 +7
Tests 1 79 0 +79
Docs 1 8 0 +8
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 6 98 2 +96

Preflight source

Source 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

Metric Value Why it matters
Production versus regression growth Production +7 net lines; tests +79 lines The production change forwards one snapshot through existing owners; the integration cases cover the previously missed admission ordering and consent rejection.

Labels

Label changes:

  • add P2: A managed-service PATH difference breaks an interactive CLI repair handoff after an update failure, with limited scope and existing manual triage commands.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P2: A managed-service PATH difference breaks an interactive CLI repair handoff after an update failure, with limited scope and existing manual triage commands.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Supply the shipped-CLI evidence described in realBehaviorProof.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 6, 2026, 4:40 AM ET / 09:40 UTC.

@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Thanks @TheRealUnknownSoldier for the fix. Here is the real behavior proof the review asked for.

Shipped-CLI behavior proof for b700adc50efe87577755dee968e11548f2700f6c:

  • Built and packaged the pinned tree, then installed the artifact in secretless remote Linux isolation. No production functions or confirmations were mocked.
  • Used a dedicated OS account with its real home and canonical named-profile state inside the isolated proof root. Installed, enabled and ran the native systemd Gateway; gateway status --json showed loaded/running with successful RPC.
  • The operator's PATH found a codex stub. The actual Gateway process PATH excluded its directory.
  • An intentional invalid config field produced a candidate-owned admission refusal: Admission checks: config: refuse, node-runtime: ok and Failing check candidate-admission (invalid-config).
  • Selecting Diagnose update failure offered Codex. Accepting printed Starting codex and PROOF_AGENT_INVOKED; its receipt retained the operator's home/CODEX_HOME and the target installation selectors, without update-run context.
  • Declining printed No repair agent was started. and created no receipt. The config hash stayed unchanged after both failed attempts.
  • Latest-stable coverage used the registry's 2026.11.1 package (4ffdd20), then the real updater replaced it with the pinned artifact (b700adc). Both have the same version number. All config fields except tool metadata (meta/wizard) were exactly equal before and after.
  • RED control at 18bee8e4252aa40d375531ff608edfd7225cb237, using the same enabled/running-service scenario, reached the same candidate refusal but printed No supported coding-agent CLI executable was found on this process's PATH. No consent prompt or launch receipt appeared.

Terminal excerpts:

GREEN accept: Agent: codex. This will use your own account/tokens.
GREEN accept: Starting codex; use --agent <name> to select another coding agent.
GREEN accept: PROOF_AGENT_INVOKED
GREEN decline: No repair agent was started.
RED: No supported coding-agent CLI executable was found on this process's PATH.
PUBLISHED BASELINE CLI: OpenClaw 2026.11.1 (4ffdd20)
UPGRADED CLI: OpenClaw 2026.11.1 (b700adc)
SETTINGS INTACT: all config fields except meta/wizard exactly equal

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.

@roboclaw-bot
roboclaw-bot merged commit 7c702c3 into openclaw:main Nov 6, 2026
216 of 219 checks passed
@TheRealUnknownSoldier

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated the PR body with real packaged-CLI macOS proof for unchanged head b700adc50efe87577755dee968e11548f2700f6c:

  • Published 2026.11.1 (4ffdd20) reproduced the false “no coding-agent CLI” result with a real managed Gateway and operator-only Codex PATH.
  • The packaged fix detected and launched the real Codex 0.165.0 binary after Yes, and respected No, on both fresh and upgraded profiles. The body includes terminal excerpts and observed native child environment selectors.
  • A real latest-stable-to-PR update completed with package activation, snapshots, Doctor, restart and readiness verification. All 10 supplied config values and the workspace marker survived.
  • Full package build and tarball-integrity validation passed; current-head CI has no failing checks. Both temporary LaunchAgents were removed afterward.

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

clawsweeper Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper could not start a re-review for this item.
Reason: re-review requires an open issue or PR.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 7, 2026
…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]>
maplel pushed a commit to maplel/openclaw that referenced this pull request Nov 24, 2026
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants