Skip to content

fix: refuse root updates of a system service that runs as another account - #206343

Merged
fuller-stack-dev merged 13 commits into
openclaw:mainfrom
fuller-stack-dev:fix/update-refuse-split-owner-system-service
Nov 27, 2026
Merged

fuller-stack-dev merged 13 commits into
openclaw:mainfrom
fuller-stack-dev:fix/update-refuse-split-owner-system-service

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Related: #204775

What Problem This Solves

A common Linux layout is a root-owned global npm package with a systemd system unit that runs the Gateway as a service account (User=openclaw, state in that account's home or the unit's OPENCLAW_STATE_DIR). Today, on the first update from published 2026.11.10:

  • sudo openclaw update exits 0 and reports success, but candidate admission, the database snapshot, Doctor, the report and the run record all check root's own empty state. The service survives only because the new Gateway migrates its own state at restart. The only warning is "service inspection is unavailable", with advice (openclaw gateway stop --force, openclaw update repair) that changes nothing as root.
  • sudo env OPENCLAW_STATE_DIR=<service state> openclaw update writes root-owned files into the service's state, the package goes back to 2026.11.10 after the new Gateway migrated the schema, and the unit stays down (exit 78) with every recovery command refusing.

User Impact

When the selected system unit is positively observed running this installation under another account, the update now stops at candidate admission, before the package is replaced. The installed updater exits 1 with service-account-mismatch, the Gateway keeps serving, and the output names the unit, its account and one procedure: make a verified backup of the service state as the service account, replace the package, restart the unit. The commands are filled in with the unit's name, account and state selectors, including a --profile from its ExecStart. For the explicit-state case it first prints the command that gives back the files the installed updater writes there as root (otherwise the service account's backup refuses). Nothing suggests openclaw update repair, gateway stop --force or Doctor as root.

Not affected: single-account installs (user units), system units that run as the updating account, units that run a different installation, and unrelated system units that are not selected. An unreadable unit is not evidence and leaves the decision to the existing checks.

The docs section has its own heading, Linux system service run by another account, with the backup step, the ownership step and why Doctor or update repair as root must not be run against the service's state.

This is the narrow guard ("option B") from the update-path owner's answer on #204775. It does not switch accounts, add a protocol, or relax custody.

Why This Change Was Made

  • Discovery keeps the fact. assertSystemdServiceAccount already refused with systemd-account-refused when a system unit's User= is not this process. The refusal now carries what discovery observed (unit, fragment path, User=, ExecStart, working directory, and the inline HOME/OPENCLAW_* selectors only; no other environment values, so tokens never travel with it) as SystemdServiceAccountRefusalError, a subclass of the same refusal, so every existing handler behaves as before. Custom-named units that discovery skips for this reason (readSystemdGatewayCommand in systemd-scope.ts) are still skipped, but discovery now reports them through an optional onAccountMismatch callback that only admission passes.
  • Admission decides before the swap. Published drivers from 2026.9.7 on (the first stable tag with candidate admission) call the candidate's openclaw update admit for package installs and stop on a refuse verdict before activation (traced in the 2026.11.10 tarball: applyUpdateCandidateAdmission throws UpdatePreMutationError while the phase is still staging). The candidate now reads the selected unit first and refuses only when the unit runs as another account and its ExecStart resolves to the installation being updated. It returns before reading the caller's state, so nothing is validated against the wrong state.
  • Text survives the driver. Shipped drivers print at most 200 characters of the reason and rewrite their own state path to $OPENCLAW_STATE_DIR, which a shell would expand to nothing. The reason stays short and path-free; paths in the printed commands quote their last component so the rewrite cannot touch them (a test runs the printed words through sh). Numeric and empty User= values become sudo -u '#<uid>' and root. The reinstall command keeps the account and package manager that own the package.
  • systemd-service-files.ts was at its 700-line cap, so the private drop-in override parser moved unchanged to systemd-drop-in-overrides.ts.

ClawSweeper's review of an earlier head found two gaps, both fixed here: a --profile in ExecStart was not applied to the printed backup selectors, and a custom-named unit dropped by discovery was not refused.

Update behavior

  • Published drivers from 2026.9.7 through 2026.11.10, package installs: reach this refusal through the candidate's openclaw update admit, before the package swap. Proven in the cells below with 2026.11.10. Older drivers have no candidate admission and are unchanged. Git installs do not run candidate admission and are unchanged.
  • A driver that is itself main: package updates go through the release path in src/update/, which does not run candidate admission, so this guard does not decide there. In the cell below it still stopped before changing anything, because stageReleaseService reads the unit with requireEffective and the account refusal aborts the run, but it prints a raw stack instead of the reason, and its preflight (src/update/run.ts, preflight({ stateDir: resolveStateDir(env) })) reads the caller's state. Not changed here; src/update/ belongs to the update-path owner.
  • No schema, stored field, config option, protocol or permission change.

Evidence

Linux Docker with systemd as PID 1, root-owned global npm install of the published 2026.11.10 driver, system unit with User=openclaw and OPENCLAW_STATE_DIR=/var/lib/openclaw/.openclaw, real agent data, a local registry serving the candidate as latest, and a 1-second /readyz probe for the whole cell. Candidates are packs of the named commit under unpublished versions.

Red, base c44c610 (candidate 2026.11.13)

Cell Result
sudo openclaw update --yes, unit openclaw-gateway.service exit 0 in 128 s, "OpenClaw updated to 2026.11.13", 15 of 128 probes not ready. Admission and snapshots used /root/.openclaw (created by this run); warning "Gateway service inspection is unavailable … run openclaw update repair".
Same, custom unit name company-gateway.service exit 0 in 104 s, same wrong-state success and warning, 14 of 103 probes not ready.
sudo env OPENCLAW_STATE_DIR=<service state> openclaw update --yes exit 1 in 109 s. Package back on 2026.11.10, state schema already 42 (2026.11.10 supports 40), unit failed, 423 of 423 probes not ready afterwards, root-owned files in the service state.

Matches the earlier report on #204775.

Green, d1998a3 (candidate 2026.11.20), two attempts each, then the printed procedure:

Cell Attempts Gateway during attempts Package, state Procedure
sudo openclaw update --yes exit 1 twice (33 s, 34 s), service-account-mismatch, phase staging 71 probes, 0 not ready, 0 restarts 2026.11.10 kept; schema 40/42 unchanged; nothing added to or removed from the service state and nothing there owned by another account (7 files changed by the serving Gateway's own writes: WAL, log) backup as openclaw ok, npm install -g, systemctl restart: ready on 2026.11.20 after 7 s
Same, custom unit company-gateway.service exit 1 twice (34 s, 33 s), same reason naming company-gateway.service 70 probes, 0 not ready, 0 restarts as above same steps with systemctl restart company-gateway.service: ready on 2026.11.20 after 8 s
sudo env OPENCLAW_STATE_DIR=<service state> openclaw update --yes exit 1 twice (33 s, 33 s), explicit-state wording 68 probes, 0 not ready, 0 restarts 2026.11.10 kept; schema unchanged; the installed 2026.11.10 updater wrote its log, report and diagnostics there as root (7, then 13 files) printed find … -exec chown openclaw, then the same steps: ready on 2026.11.20 after 10 s; schema 42/45 after the new Gateway's own migration

Second attempts gave the same reason. Recordings (terminal, 4x speed):

Negative controls

Control Base c44c610 (2026.11.13) Head
Single-account install, user unit, openclaw update --yes (64 MiB agent database under 64 KiB/s writes) exit 0 in 150 s, serving 2026.11.13, 58.7 s longest outage d1998a3: exit 0 in 124 s, serving 2026.11.20, 49.1 s longest outage; no managed-service-account check
Root-owned install, system unit running as root, sudo openclaw update --yes admission config, database-schema, node-runtime, plugin-availability: ok; exit 1 in 88 s at activation, "another managed Gateway (systemd system unit …) is still using this installation"; 0 of 87 probes not ready d1998a3: identical, 89 s, 0 of 89
Same plus an unrelated, unselected system unit (openclaw-gateway-work.service, User=openclaw, other state and port) identical to the row above, 90 s 506fd90: identical, 99 s; the unrelated unit is not read
Service account runs its own openclaw update --yes exit 1 in 11 s, global-install-permission-denied, 0 probes not ready 506fd90: same, 10 s (refused by the installed updater before admission runs)

The root-unit rows fail on base too: the published 2026.11.10 updater refuses to replace a package that a system unit is running. This change leaves that unchanged; it is listed for the update-path owner. The last two rows ran on 506fd90, an earlier head of this branch: they do not reach the code changed since (the account-refused path and custom-unit reporting).

main as the installed driver (driver: pack of 37cb52c, an earlier head of this branch, as 2026.11.14; candidate 2026.11.15): sudo openclaw update --yes takes the release path and exits 1 in 50 s at release staging with "The update failed before anything changed", the package stays on 2026.11.14 and 0 of 50 probes were not ready. The printed reason is a raw stack from stageReleaseService reading the unit, not this refusal. Not run on base.

Raw output: green refusal (d1998a3, plain sudo, attempt 1)
]  ✓ package-install (13.77s)
Phase: staging
Phase: finished
⚠️ OpenClaw update failed: service-account-mismatch.
Report: /root/.openclaw/update-reports/e53b4883-0ab6-4896-a92b-ad1a5b011cda.md
Read report (shell): cat -- /root/.openclaw/update-reports/e53b4883-0ab6-4896-a92b-ad1a5b011cda.md
Cause: service-failed
Update mode: npm
Update safety checks ran in the candidate updater (2026.11.20).
Admission checks: managed-service-account: refuse.
Phases: requested (15.44s) → staging (7.18s)
Failed: staging
Failed: candidate-admission — [{"name":"managed-service-account","status":"refuse","detail":"Gateway service openclaw-gateway.service runs as openclaw, but this update runs as root and would back up and check root's own state instead of the service's."}]
Failed: service-account-mismatch — Exit code: 1; Gateway service openclaw-gateway.service runs as openclaw, but this update runs as root and would back up and check root
Failing check candidate-admission (service-account-mismatch): Gateway service openclaw-gateway.service runs as openclaw, but this update runs as root and would back up and check root's own state instead of the service's.
Failing check update (update-failed)
Nothing was changed: the package, the service state and the running Gateway are as they were. Update this system service by hand (https://docs.openclaw.ai/install/updating#linux-system-service-run-by-another-account). First make a verified backup of its state as openclaw: sudo -u openclaw env HOME=/var/lib/openclaw OPENCLAW_STATE_DIR=/var/lib/openclaw/.openclaw openclaw backup create --verify --output /var/lib/openclaw. Then run sudo npm install -g [email protected] --allow-scripts=openclaw and sudo systemctl restart openclaw-gateway.service.
Preparing triage diagnostics...
Saved failure diagnostics: /root/.openclaw/logs/support/openclaw-update-failure-0884ea2c_24d6_40a0_85db_d1d99ddc1818.json
To start a repair agent, run env OPENCLAW_STATE_DIR='/root/.openclaw' OPENCLAW_CONFIG_PATH='/root/.openclaw/openclaw.json' OPENCLAW_WORKSPACE_DIR='/root/.openclaw/workspace' openclaw triage --run --update-result /root/.openclaw/logs/support/openclaw-update-failure-0884ea2c_24d6_40a0_85db_d1d99ddc1818.json
Debugging prompt: /root/.openclaw/logs/support/openclaw-triage-prompt-2026-11-27T11-31-38-805Z-2299.md
Sanitized diagnostics: /root/.openclaw/logs/support/openclaw-diagnostics-2026-11-27T11-31-38-405Z-2299.zip
No repair agent was started.
Next step:
  env OPENCLAW_STATE_DIR='/root/.openclaw' OPENCLAW_CONFIG_PATH='/root/.openclaw/openclaw.json' OPENCLAW_WORKSPACE_DIR='/root/.openclaw/workspace' openclaw triage --run --update-result /root/.openclaw/logs/support/openclaw-update-failure-b9ed4e39_93bb_4faf_8bd0_e3dd7088d131.json
Triage diagnostics saved; no repair agent was started.
exit 1
Raw output: green refusal (d1998a3, custom unit, attempt 1)
]  ✓ package-install (15.12s)
Phase: staging
Phase: finished
⚠️ OpenClaw update failed: service-account-mismatch.
Report: /root/.openclaw/update-reports/42484a82-f828-43d4-81c5-f6419092ece6.md
Read report (shell): cat -- /root/.openclaw/update-reports/42484a82-f828-43d4-81c5-f6419092ece6.md
Cause: service-failed
Update mode: npm
Update safety checks ran in the candidate updater (2026.11.20).
Admission checks: managed-service-account: refuse.
Phases: requested (16.76s) → staging (7.63s)
Failed: staging
Failed: candidate-admission — [{"name":"managed-service-account","status":"refuse","detail":"Gateway service company-gateway.service runs as openclaw, but this update runs as root and would back up and check root's own state instead of the service's."}]
Failed: service-account-mismatch — Exit code: 1; Gateway service company-gateway.service runs as openclaw, but this update runs as root and would back up and check root'
Failing check candidate-admission (service-account-mismatch): Gateway service company-gateway.service runs as openclaw, but this update runs as root and would back up and check root's own state instead of the service's.
Failing check update (update-failed)
Nothing was changed: the package, the service state and the running Gateway are as they were. Update this system service by hand (https://docs.openclaw.ai/install/updating#linux-system-service-run-by-another-account). First make a verified backup of its state as openclaw: sudo -u openclaw env HOME=/var/lib/openclaw OPENCLAW_STATE_DIR=/var/lib/openclaw/.openclaw openclaw backup create --verify --output /var/lib/openclaw. Then run sudo npm install -g [email protected] --allow-scripts=openclaw and sudo systemctl restart company-gateway.service.
Preparing triage diagnostics...
Saved failure diagnostics: /root/.openclaw/logs/support/openclaw-update-failure-8da02ff3_a828_4be5_abab_4ccce870dadc.json
To start a repair agent, run env OPENCLAW_STATE_DIR='/root/.openclaw' OPENCLAW_CONFIG_PATH='/root/.openclaw/openclaw.json' OPENCLAW_WORKSPACE_DIR='/root/.openclaw/workspace' openclaw triage --run --update-result /root/.openclaw/logs/support/openclaw-update-failure-8da02ff3_a828_4be5_abab_4ccce870dadc.json
Debugging prompt: /root/.openclaw/logs/support/openclaw-triage-prompt-2026-11-27T11-08-13-037Z-2695.md
Sanitized diagnostics: /root/.openclaw/logs/support/openclaw-diagnostics-2026-11-27T11-08-12-420Z-2695.zip
No repair agent was started.
Next step:
  env OPENCLAW_STATE_DIR='/root/.openclaw' OPENCLAW_CONFIG_PATH='/root/.openclaw/openclaw.json' OPENCLAW_WORKSPACE_DIR='/root/.openclaw/workspace' openclaw triage --run --update-result /root/.openclaw/logs/support/openclaw-update-failure-5a56d47e_155f_4a3c_bbd6_699fc799d2ec.json
Triage diagnostics saved; no repair agent was started.
exit 1
Raw output: green refusal (d1998a3, explicit service state, attempt 1)
]  ✓ package-install (15.19s)
Phase: staging
Phase: finished
⚠️ OpenClaw update failed: service-account-mismatch.
Report: /var/lib/openclaw/.openclaw/update-reports/f2af2a8c-e6ee-4999-a391-9e1fdc9cc852.md
Read report (shell): cat -- /var/lib/openclaw/.openclaw/update-reports/f2af2a8c-e6ee-4999-a391-9e1fdc9cc852.md
Cause: service-failed
Update mode: npm
Update safety checks ran in the candidate updater (2026.11.20).
Admission checks: managed-service-account: refuse.
Phases: requested (16.36s) → staging (7.27s)
Failed: staging
Failed: candidate-admission — [{"name":"managed-service-account","status":"refuse","detail":"Gateway service openclaw-gateway.service runs as openclaw, but this update runs as root and would write that service's state as root."}]
Failed: service-account-mismatch — Exit code: 1; Gateway service openclaw-gateway.service runs as openclaw, but this update runs as root and would write that service's s
Failing check candidate-admission (service-account-mismatch): Gateway service openclaw-gateway.service runs as openclaw, but this update runs as root and would write that service's state as root.
Failing check update (update-failed)
The package and the running Gateway were not changed, but this run writes its log and report into that state as root; give them back to openclaw first: sudo find /var/lib/openclaw/'.openclaw' -xdev -user 0 -exec chown openclaw {} +. Update this system service by hand (https://docs.openclaw.ai/install/updating#linux-system-service-run-by-another-account). First make a verified backup of its state as openclaw: sudo -u openclaw env HOME=/var/lib/openclaw OPENCLAW_STATE_DIR=/var/lib/openclaw/'.openclaw' openclaw backup create --verify --output /var/lib/openclaw. Then run sudo npm install -g [email protected] --allow-scripts=openclaw and sudo systemctl restart openclaw-gateway.service.
Preparing triage diagnostics...
Saved failure diagnostics: /var/lib/openclaw/.openclaw/logs/support/openclaw-update-failure-8e620f42_b444_4915_932d_3e2d248aea09.json
To start a repair agent, run env OPENCLAW_STATE_DIR='/var/lib/openclaw/.openclaw' OPENCLAW_CONFIG_PATH='/var/lib/openclaw/.openclaw/openclaw.json' OPENCLAW_WORKSPACE_DIR='/var/lib/openclaw/.openclaw/workspace' openclaw triage --run --update-result /var/lib/openclaw/.openclaw/logs/support/openclaw-update-failure-8e620f42_b444_4915_932d_3e2d248aea09.json
Debugging prompt: /var/lib/openclaw/.openclaw/logs/support/openclaw-triage-prompt-2026-11-27T11-24-04-354Z-2284.md
Sanitized diagnostics: /var/lib/openclaw/.openclaw/logs/support/openclaw-diagnostics-2026-11-27T11-24-03-938Z-2284.zip
No repair agent was started.
Next step:
  env OPENCLAW_STATE_DIR='/var/lib/openclaw/.openclaw' OPENCLAW_CONFIG_PATH='/var/lib/openclaw/.openclaw/openclaw.json' OPENCLAW_WORKSPACE_DIR='/var/lib/openclaw/.openclaw/workspace' openclaw triage --run --update-result /var/lib/openclaw/.openclaw/logs/support/openclaw-update-failure-d1a764e2_05f9_4f26_bdd4_560c02cd9ba8.json
Triage diagnostics saved; no repair agent was started.
exit 1
Raw output: red tails (base c44c610)
== sudo openclaw update --yes (tail)
    Doctor: maintenance finish
    Doctor: maintenance release
    [update] Doctor changed config key: meta.
    [update] Doctor changed config key: plugins.
    [update] Doctor changed config key: wizard.
    [update] Doctor migration: Recorded webhook listener decisions; removed pins will not be recreated.
    core/doctor/gateway-config: gateway.mode is unset; gateway start will be blocked.
    Post-install doctor reported a recoverable update-time repair warning after the package install was verified; continuing with post-core plugin convergence.
Gateway service inspection is unavailable; automatic service restart was skipped. Any recorded service definition was left unchanged; inspect it with `openclaw gateway status --deep`. Stop the Gateway through its owner (`openclaw gateway stop --force` for the managed service), then run `openclaw update repair`.
Deferred Doctor inspections did not complete after restart (Gateway readiness was not verified). Run `openclaw doctor --lint --all --severity-min info` to inspect them.
Finishing update: checking package backup retention and cleanup.
Updating plugins...
No plugin updates needed.
✅ OpenClaw updated to 2026.11.13.
Next: After confirming the update and your conversations are healthy, preview retained migration originals eligible for permanent cleanup with `openclaw update cleanup --dry-run` for state `/root/.openclaw`. Before applying cleanup, stop the Gateway first (`openclaw gateway stop --force`). Use the same profile, state, and config settings.
Warning: core/doctor/gateway-config: gateway.mode is unset; gateway start will be blocked.
Warning: Repaired permissions on 46925 retained package objects: "[path]", "[path]/CHANGELOG.md", "[path]/LICENSE". Group/other write permissions and POSIX ACL write masks were cleared; read/execute access was preserved.
Warning: Gateway service inspection is unavailable; automatic service restart was skipped. Any recorded service definition was left unchanged; inspect it with `openclaw gateway status --deep`. Stop the Gateway through its owner (`openclaw gateway stop --force` for the managed service), then run `openclaw update repair`.
Warning: Deferred Doctor inspections did not complete after restart (Gateway readiness was not verified). Run `openclaw doctor --lint --all --severity-min info` to inspect them.
Update backup cleanup removed 0 items (0 logical bytes, 0 MiB). Kept 3 the updater still needs.
03:34:33 [infra:temp-artifacts] Runtime retained at /usr/local/lib/openclaw-update-runtime-QWIrA1: worker generation settled; cleanup deferred to the next eligible update or openclaw doctor --fix
exit 0

== sudo env OPENCLAW_STATE_DIR=/var/lib/openclaw/.openclaw openclaw update --yes (tail)
Use a build that supports schema 42 or newer with this state directory. To use an older build, restore your pre-update backup created with openclaw backup create.
See https://docs.openclaw.ai/reference/database-schemas.
First failure: doctor-failed | gateway.maintenance_required
Update recovery remains pending (post-update-failed). Retained state and artifacts were left for the owning updater to reconcile; automatic restart and repair were not attempted.
Update terminal preparation failed | This OpenClaw build cannot open your existing data.
OpenClaw state database /var/lib/openclaw/.openclaw/state/openclaw.sqlite uses newer schema version 42; this build supports 40.
Refused by OpenClaw 2026.11.10 (6ea542f) installed at /usr/local/lib/openclaw-update-runtime-g3tiIl/tree/2f/usr/local/lib/node_modules/openclaw.
Use a build that supports schema 42 or newer with this state directory. To use an older build, restore your pre-update backup created with openclaw backup create.
See https://docs.openclaw.ai/reference/database-schemas. | This OpenClaw build cannot open your existing data.
OpenClaw state database /var/lib/openclaw/.openclaw/state/openclaw.sqlite uses newer schema version 42; this build supports 40.
Refused by OpenClaw 2026.11.10 (6ea542f) installed at /usr/local/lib/openclaw-update-runtime-g3tiIl/tree/2f/usr/local/lib/node_modules/openclaw.
Use a build that supports schema 42 or newer with this state directory. To use an older build, restore your pre-update backup created with openclaw backup create.
See https://docs.openclaw.ai/reference/database-schemas.
First failure: doctor-failed | gateway.maintenance_required
03:56:41 [infra:temp-artifacts] Runtime retained at /usr/local/lib/openclaw-update-runtime-g3tiIl: worker generation settled; cleanup deferred to the next eligible update or openclaw doctor --fix
exit 1

== unit after the explicit-state run
--- unit
MainPID=0
Result=exit-code
NRestarts=2
ExecMainStartTimestamp=Fri 2026-11-27 03:56:05 UTC
ExecMainStatus=78
ActiveState=failed
SubState=failed
--- service state: files not owned by openclaw

== sudo openclaw update --yes, unit company-gateway.service (tail)
Finishing update: checking package backup retention and cleanup.
Updating plugins...
No plugin updates needed.
✅ OpenClaw updated to 2026.11.13.
Next: After confirming the update and your conversations are healthy, preview retained migration originals eligible for permanent cleanup with `openclaw update cleanup --dry-run` for state `/root/.openclaw`. Before applying cleanup, stop the Gateway first (`openclaw gateway stop --force`). Use the same profile, state, and config settings.
Warning: core/doctor/gateway-config: gateway.mode is unset; gateway start will be blocked.
Warning: Repaired permissions on 46925 retained package objects: "[path]", "[path]/CHANGELOG.md", "[path]/LICENSE". Group/other write permissions and POSIX ACL write masks were cleared; read/execute access was preserved.
Warning: Gateway service inspection is unavailable; automatic service restart was skipped. Any recorded service definition was left unchanged; inspect it with `openclaw gateway status --deep`. Stop the Gateway through its owner (`openclaw gateway stop --force` for the managed service), then run `openclaw update repair`.
Warning: Deferred Doctor inspections did not complete after restart (Gateway readiness was not verified). Run `openclaw doctor --lint --all --severity-min info` to inspect them.
Update backup cleanup removed 0 items (0 logical bytes, 0 MiB). Kept 3 the updater still needs.
10:52:22 [infra:temp-artifacts] Runtime retained at /usr/local/lib/openclaw-update-runtime-F6oS1d: worker generation settled; cleanup deferred to the next eligible update or openclaw doctor --fix
exit 0

Which commit the proof covers. The cells ran on d1998a3. The PR head e2546af adds only a test consolidation (to stay inside the test-line allowance) and a merge of main; between them no production file in this change's path differs (admission, systemd discovery, CLI profile parsing, support redaction, run schema). The main side touched src/config/config-env-vars.ts and session readers, which the refusal path does not reach, so the cells were not repeated.

Tests and checks on e2546af:

  • src/cli/update-cli/update-command-admit.service-account.test.ts (new): runs updateAdmitCommand with the unit selection and bus read fed as observed results (their owners are tested in the two daemon files). Refuses with the exact reason and next action and leaves the fixture files unchanged; explicit-state wording, with the printed commands run through redactSupportString and sh to prove they still name the state path; owning account and pnpm; numeric User=; environment-file selectors; --profile in ExecStart; a custom unit reported by discovery. Negative cases: other installation, same account, a skipped custom unit running another installation, unreadable unit, user unit, no unit, non-Linux. Each refusal case was shown red by disabling its branch.
  • src/daemon/systemd-service-files.scope.test.ts: whole file audited; one table case added (3 rows) proving the refusal carries unit, account, command and inline selectors, marks environment-file and unset selectors as incomplete, never carries other environment values and never reads the environment file. No cases removed.
  • src/daemon/systemd-scope.identity.test.ts: whole file audited; one table case added (2 rows) proving custom discovery still skips a unit run by another account, reports the observation, and reports nothing for a refusal without one. Red without the callback. No cases removed.
  • Also run and passing: update-command-admit.test.ts, .workshop, .heartbeat, systemd-service-identity.test.ts, systemd.test.ts, systemd.environment-preservation.test.ts, service.systemd-scope.test.ts, systemd-definition-mutation.test.ts, test/scripts/update-restart-module-outcome.test.ts, test/scripts/eager-import-closure.test.ts.
  • node scripts/check-changed.mjs: format, lint, typecheck and guards pass; the dead-export scan fails only on exports already unused on main (none in this change). Test-line ratchet: +399 of 400. Session identity ratchet: OK.
  • Autoreview, Codex route (gpt-6.1-sol, thinking high), --max-priority P2 (P0 through P2), branch mode against origin/main: scoped-clean on e2546af. Earlier P2 passes on this branch found two issues, both fixed: the Bun/pnpm reinstall moving to root's global directory, and numeric User= values for sudo -u.

Not proven

  • Drivers other than 2026.11.10 were traced from the admission contract, not run.
  • Selectors from EnvironmentFile= are not read; the refusal then asks for the unit's selectors instead of printing them.
  • The release path (main as the installed driver) stops before changing anything but prints a stack instead of this reason; not changed here.
  • After a refusal the installed 2026.11.10 updater still prints its own Cause: service-failed line and a triage suggestion for the state it used, and in the explicit-state case writes its log, report and diagnostics into the service state as root (the refusal prints the command that returns them). Those lines come from the installed updater and cannot change on this hop.
  • The --profile case is covered by tests, not by a cell. No macOS, Windows or pnpm/Bun cell.

…account

When a published updater runs as root and the selected systemd system unit
runs this package under another account, candidate admission now refuses
before the package is replaced. Plain sudo would back up and check root's own
state; pointing OPENCLAW_STATE_DIR at the service state would write it as
root. The refusal names the unit, its account and the documented
system-service procedure, starting with a verified backup of the service state.

Service discovery keeps the observed unit, account and inline state selectors
on the existing systemd-account-refused refusal so admission can tell this
case from an unreadable service. The drop-in override parser moves to its own
module to keep systemd-service-files.ts under the line cap.
@clawsweeper

clawsweeper Bot commented Nov 27, 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 gateway Gateway runtime cli CLI command changes size: L labels Nov 27, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. labels Nov 27, 2026
@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. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 27, 2026
@fuller-stack-dev
fuller-stack-dev marked this pull request as ready for review November 27, 2026 04:00
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 27, 2026
@clawsweeper

clawsweeper Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR refuses candidate admission when the selected systemd service runs the installation under another account and provides manual update guidance.

Example: Root runs openclaw update while openclaw-gateway.service uses User=openclaw and /var/lib/openclaw/.openclaw.

  • Before: Candidate admission checks root's state and can allow an update that leaves the service unhealthy.
  • After: Admission refuses with the service account and instructions to back up its state before manually replacing the package.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The approved repair has clear value, but unsafe profile-specific backup guidance, an incomplete discovery path, and unfinished real-behavior proof block a pass.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦪 silver shellfish (2/6) 2 actionable review findings remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: A root-owned package update can validate the wrong account's state and report success while its service-account Gateway fails to start.
Reason: The maintainer-authored direction and linked decision approve this narrow refusal, but custom-unit discovery still bypasses it.

Merge readiness

⛔ Needs changes before merge - 2 items remain

Keep this PR open: the maintainer-approved refusal addresses a documented update failure, but custom-unit discovery and profile-specific backup guidance need correction.

Reviewed head: fa17f00d9bc25d23ee56b8543dde208927db0187

Before merge

  • Preserve the service's command-line profile in backup guidance (P1) - For a selected unit with User=openclaw, HOME=/var/lib/openclaw, and ExecStart ending in --profile prod gateway, the mismatch contains the profile in programArguments but not necessarily in selectors. formatRefusal builds unitEnv only from inline selectors and emits a backup command without --profile prod or its derived state path. That command targets /var/lib/openclaw/.openclaw instead of /var/lib/openclaw/.openclaw-prod, then tells the operator to replace the package and restart. The required backup can therefore omit the state being migrated. Apply the existing CLI-profile semantics before formatting concrete backup commands, or mark the selectors incomplete when they cannot be resolved.
  • Carry custom-unit account mismatches through discovery (P2) - With no conventional user/system unit and an OpenClaw-marked custom unit such as company-gateway.service running the updated package as User=openclaw, findInstalledSystemdGatewayScope enters custom discovery. Its readSystemdGatewayCommand catches systemd-account-refused and returns null at systemd-scope.ts:271–272, so custom discovery skips the unit and returns null. This new inspector then returns without refusing, leaving the original wrong-state admission path reachable despite positively observing the account mismatch. Preserve that observation for admission while retaining selected-unit and installation matching; the added tests mock discovery and cannot catch this path.

Findings

  • [P1] Preserve the service's command-line profile in backup guidance — src/cli/update-cli/update-command-admit-service-account.ts:76-79
  • [P2] Carry custom-unit account mismatches through discovery — src/cli/update-cli/update-command-admit-service-account.ts:40-44

Tests

  • Missing end-to-end proof: Provide redacted shipped-CLI upgrade captures from the latest stable showing both split-owner refusals before replacement with package, state, and service preserved, plus single-owner, root-run, unrelated-unit, custom-unit, and profile-specific backup controls; base-red/head-green regression results are not supplied.
Agent review details

How this fits together

Shipped updaters invoke the target release's candidate-admission CLI, which inspects systemd ownership and returns an admission verdict before package replacement.

flowchart TD
  A[Installed updater] --> B[Candidate admission CLI]
  B --> C[Systemd unit discovery]
  C --> D[Effective service account]
  D --> E[Installation matching]
  E --> F[Refusal and manual guidance]
  E --> G[Existing state admission]
Loading

Technical review

Best possible solution:

Preserve account-mismatch observations through selected-unit discovery and derive backup guidance from the service's effective profile and state selectors.

Do we have a high-confidence way to reproduce the issue?

The linked release report establishes the wrong-state update failure, and source tracing establishes both review findings; no target code was executed during this read-only review.

Is this the best way to solve the issue?

A candidate-side refusal fits the approved shipped-updater repair, but it must survive real discovery and produce a backup command for the state the service actually uses.

Full review comments:

  • [P1] Preserve the service's command-line profile in backup guidance — src/cli/update-cli/update-command-admit-service-account.ts:76-79
    For a selected unit with User=openclaw, HOME=/var/lib/openclaw, and ExecStart ending in --profile prod gateway, the mismatch contains the profile in programArguments but not necessarily in selectors. formatRefusal builds unitEnv only from inline selectors and emits a backup command without --profile prod or its derived state path. That command targets /var/lib/openclaw/.openclaw instead of /var/lib/openclaw/.openclaw-prod, then tells the operator to replace the package and restart. The required backup can therefore omit the state being migrated. Apply the existing CLI-profile semantics before formatting concrete backup commands, or mark the selectors incomplete when they cannot be resolved.
    Confidence: 0.98
  • [P2] Carry custom-unit account mismatches through discovery — src/cli/update-cli/update-command-admit-service-account.ts:40-44
    With no conventional user/system unit and an OpenClaw-marked custom unit such as company-gateway.service running the updated package as User=openclaw, findInstalledSystemdGatewayScope enters custom discovery. Its readSystemdGatewayCommand catches systemd-account-refused and returns null at systemd-scope.ts:271–272, so custom discovery skips the unit and returns null. This new inspector then returns without refusing, leaving the original wrong-state admission path reachable despite positively observing the account mismatch. Preserve that observation for admission while retaining selected-unit and installation matching; the added tests mock discovery and cannot catch this path.
    Confidence: 0.97

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 2237f16b7e27.

Provenance checked

  • Systemd account refusal keeps the original intent (d8b5ea0: Keep service discovery and maintenance scoped to the selected account and profile while retaining supported custom system-unit names.)
  • Drop-in override parser relocation keeps the original intent (fda20a6: Honor manager-loaded drop-in configuration while preserving authored definitions and operator ownership for mutations.)
  • System-service update documentation changes intended behavior with a stated reason (3af404d: Keep root maintenance in the trusted package and document service-account selectors and administrator-managed replacement.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test src/cli/update-cli/update-command-admit.service-account.test.ts --maxWorkers=1
  • pnpm test src/daemon/systemd-service-files.scope.test.ts --maxWorkers=1
  • pnpm test src/daemon/systemd-scope.identity.test.ts --maxWorkers=1
  • git diff --check

What I checked:

PR surface

Source +203, Tests +304, Docs +44. Total +551 across 9 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 6 328 125 +203
Tests 2 304 0 +304
Docs 1 53 9 +44
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 685 134 +551

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.

Labels

Label changes:

  • add merge-risk: 🚨 compatibility: Existing split-owner automatic updates become refusals requiring manual package replacement; this operator handoff is explicitly accepted in the linked design discussion.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • merge-risk: 🚨 compatibility: Existing split-owner automatic updates become refusals requiring manual package replacement; this operator handoff is explicitly accepted in the linked design discussion.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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 26, 2026, 11:16 PM ET / November 27, 2026, 04:16 UTC.

@fuller-stack-dev
fuller-stack-dev merged commit 74f02b4 into openclaw:main Nov 27, 2026
130 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

@fuller-stack-dev
fuller-stack-dev deleted the fix/update-refuse-split-owner-system-service branch November 27, 2026 12:04
tideclaw-bot pushed a commit that referenced this pull request Nov 28, 2026
…ount (#206343)

* fix(update): refuse a root update of a system service run by another account

When a published updater runs as root and the selected systemd system unit
runs this package under another account, candidate admission now refuses
before the package is replaced. Plain sudo would back up and check root's own
state; pointing OPENCLAW_STATE_DIR at the service state would write it as
root. The refusal names the unit, its account and the documented
system-service procedure, starting with a verified backup of the service state.

Service discovery keeps the observed unit, account and inline state selectors
on the existing systemd-account-refused refusal so admission can tell this
case from an unreadable service. The drop-in override parser moves to its own
module to keep systemd-service-files.ts under the line cap.

* fix(update): keep the manual reinstall with the account that owns the package

* fix(update): name the updating account instead of a path drivers redact

* fix(update): format numeric and default service accounts for sudo

* fix(update): keep the refusal reason within what shipped drivers print

* fix(update): return root-written files before the service-state backup

* fix(update): keep printed service paths intact through driver redaction

* fix(update): refuse for skipped custom units and honor ExecStart profiles

* test(update): consolidate service-account admission cases

(cherry picked from commit 74f02b4)

Backport adaptation: Keep release update documentation around the new service-account guidance. The refusal uses the existing update admission protocol and free-form reason code; production and tests are otherwise unchanged.

Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 28, 2026
…ount (openclaw#206343)

* fix(update): refuse a root update of a system service run by another account

When a published updater runs as root and the selected systemd system unit
runs this package under another account, candidate admission now refuses
before the package is replaced. Plain sudo would back up and check root's own
state; pointing OPENCLAW_STATE_DIR at the service state would write it as
root. The refusal names the unit, its account and the documented
system-service procedure, starting with a verified backup of the service state.

Service discovery keeps the observed unit, account and inline state selectors
on the existing systemd-account-refused refusal so admission can tell this
case from an unreadable service. The drop-in override parser moves to its own
module to keep systemd-service-files.ts under the line cap.

* fix(update): keep the manual reinstall with the account that owns the package

* fix(update): name the updating account instead of a path drivers redact

* fix(update): format numeric and default service accounts for sudo

* fix(update): keep the refusal reason within what shipped drivers print

* fix(update): return root-written files before the service-state backup

* fix(update): keep printed service paths intact through driver redaction

* fix(update): refuse for skipped custom units and honor ExecStart profiles

* test(update): consolidate service-account admission cases
tideclaw-bot pushed a commit that referenced this pull request Nov 28, 2026
…ount (#206343)

* fix(update): refuse a root update of a system service run by another account

When a published updater runs as root and the selected systemd system unit
runs this package under another account, candidate admission now refuses
before the package is replaced. Plain sudo would back up and check root's own
state; pointing OPENCLAW_STATE_DIR at the service state would write it as
root. The refusal names the unit, its account and the documented
system-service procedure, starting with a verified backup of the service state.

Service discovery keeps the observed unit, account and inline state selectors
on the existing systemd-account-refused refusal so admission can tell this
case from an unreadable service. The drop-in override parser moves to its own
module to keep systemd-service-files.ts under the line cap.

* fix(update): keep the manual reinstall with the account that owns the package

* fix(update): name the updating account instead of a path drivers redact

* fix(update): format numeric and default service accounts for sudo

* fix(update): keep the refusal reason within what shipped drivers print

* fix(update): return root-written files before the service-state backup

* fix(update): keep printed service paths intact through driver redaction

* fix(update): refuse for skipped custom units and honor ExecStart profiles

* test(update): consolidate service-account admission cases

(cherry picked from commit 74f02b4)

Release adaptation: Production and test changes are identical to main. Resolve the documentation conflict by inserting only the new service-account notice and manual procedure before the stable update implementation contract, retaining existing stable guidance and omitting main-only local-packaged-code-overrides context. The notice specifies refusal before package replacement, since the installed driver may already have emitted logs or a report. Later same-file edits are documentation for separate work: #206560 core readiness, #206530 legacy Linux lock recovery, #206867 legacy auth cleanup, #206926 boot-time plugin convergence, and #207062 recovery of selected old main checkouts. None is required for or included with this refusal.

Co-authored-by: RomneyDa <[email protected]>
obviyus added a commit that referenced this pull request Nov 28, 2026
## What Problem This Solves

A root-owned global OpenClaw package can serve a systemd system unit running as another account (`User=`). Updating it as root must not run state work against `/root` or write the service account's state as root. Today the cross-account candidate refuses and prints a manual procedure.

## User Impact

For a positively identified matching system unit, `sudo openclaw update --yes` replaces only the package as root and restarts the existing unit. Its own boot, running as `User=`, owns migrations and plugin convergence. Root does not run Doctor, finalize, snapshots, config/RPC/run writes, or update-report persistence.

The CLI requires systemd to report the unit active and prints `systemctl status <unit>` and `journalctl -u <unit>` without claiming readiness. The existing HTTP readiness helper needs the service's TLS configuration; root must not open that state, so this path uses the systemd-active fallback instead of assuming HTTP. A failed restart or inactive unit fails the CLI. `--no-restart` explicitly reports that the package still needs activation. The saved update channel is not changed by this package-only path.

## Why This Change Was Made

This follows the maintainer-directed package/state ownership split: root owns package replacement; the service owns state at boot. The branch occurs before update state setup and reuses #206343's installation/unit identification, the existing staged package installer, and the blocking systemctl owner. A state-free `runuser ... <recorded runtime> --version` probe runs as `User=` before replacement, with a sanitized launch environment; failure or an incompatible version refuses with its cause and next step. No service-controlled runtime is executed as root. The manual-procedure shell formatter and its obsolete tests are removed; shipped-candidate and non-root cross-account state checks remain refused, with a working documented manual recovery route for older installed updaters.

Scope boundary: the remaining frozen bridge state readers are not migrated or orchestrated here; they stay for their shipped contracts until the first-hop floor permits bridge deletion. launchd, Windows, and single-account update paths are unchanged.

Thanks to @fuller-stack-dev for #206343's system-account identification and #207230's 33-line `src/daemon/systemd-service-account-command.ts` helper. The original helper functions and synchronous argv API remain unchanged at the same path. The only addition is a 23-line NSS login-name resolver: systemd accepts numeric `User=1001`, but `runuser -u` requires its login name. None of #207230's bridge orchestration is inherited, and its branch remains untouched. The helper contribution is credited with the verified GitHub noreply co-author trailer.

Author pr-simplify completed: one reused identification and package operation, no new persisted records, statuses, phases, leases, notices, retries, flags, or triggers. Against `dfd17d025fe0`: production net **+227 lines**, test net **+189**, docs net **+23**. The positive production net is the complete package/runtime-check/restart operation replacing a refusal, plus the command helper and numeric-account resolution. No state-maintenance or bridge orchestration is added.

## Evidence

- Red on the unchanged main source (`dfd17d025fe0`): the new real `updateCommand` boundary regression reached the forbidden root state-setup tripwire instead of replacing the package/restarting the unit.
- Final head `18627bcd4b65641eb80a69a774b3e0d01a97ae6c`: source regressions passed with the repository wrappers under both the pinned Bun fork (11 tests) and Node (21 tests including candidate admission), 94.11 s combined wall time. The earlier full focused selection, including unchanged `src/update/cli.test.ts`, passed 64 tests on `c8bd81b367df0fd02389453b6cc54eea7d755207`.
- Scoped Oxfmt and type-aware Oxlint checks pass on the three repaired files (19.71 s); earlier scoped formatting and lint cover the unchanged files.
- Unit proof covers default root state and explicit service-state selectors, account-isolated version-probe argv/environment, numeric UID-to-login resolution and mismatched NSS rejection, incompatible recorded Node and exact probe failures before replacement, blocking restart completion, restart failure/inactive units, and `--no-restart`. Package installation, NSS lookup, the version-probe subprocess, and native service operations are mocked at their existing I/O boundaries; this is not live systemd proof.
- No existing system-unit-with-`User=` proof harness was found. `ci-published-driver-update.yml` / `scripts/e2e/lib/upgrade-survivor/native-systemd.mjs` uses `systemctl --user`, not system units. No hosted container run is claimed. Proof is unit tests plus PR CI.
- Full builds/type checks are left to hosted CI per the host constraint. First-head CI: https://github.com/openclaw/openclaw/actions/runs/46119231572 — architecture failed on the untouched `ui/src/pages/skill-workshop/action-presentation.ts` ↔ `skill-workshop-page.tsx` Madge cycle; runtime import-cycle and Kysely checks passed.
- Prior-head CI (`6804c4623254ca899dcab5d01f794f2f58ae3057`): https://github.com/openclaw/openclaw/actions/runs/46120628365 caught a fixture bug: its Bun shard made `process.execPath` describe a Bun service, so the intended Node-engine refusal did not apply. The fixture now records `/usr/bin/node` independently of the runner, preserving every refusal assertion. The two unnecessary deferred type arguments were also removed. Final-head CI is pending; no local full build or third review is claimed.
- Local ClawSweeper completed two rounds. Its TLS/legacy-recovery findings and then its service-runtime/queued-restart findings were repaired. The latter now uses the maintainer-approved state-free account probe and blocking systemctl restart. No third review is claimed; the package-only/no-root-state contract and unit+CI proof scope are the maintainer-selected direction.

Related: #204775, #206343. No release branch changes.

Co-authored-by: Jason (Json) <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 29, 2026
…law#207304)

## What Problem This Solves

A root-owned global OpenClaw package can serve a systemd system unit running as another account (`User=`). Updating it as root must not run state work against `/root` or write the service account's state as root. Today the cross-account candidate refuses and prints a manual procedure.

## User Impact

For a positively identified matching system unit, `sudo openclaw update --yes` replaces only the package as root and restarts the existing unit. Its own boot, running as `User=`, owns migrations and plugin convergence. Root does not run Doctor, finalize, snapshots, config/RPC/run writes, or update-report persistence.

The CLI requires systemd to report the unit active and prints `systemctl status <unit>` and `journalctl -u <unit>` without claiming readiness. The existing HTTP readiness helper needs the service's TLS configuration; root must not open that state, so this path uses the systemd-active fallback instead of assuming HTTP. A failed restart or inactive unit fails the CLI. `--no-restart` explicitly reports that the package still needs activation. The saved update channel is not changed by this package-only path.

## Why This Change Was Made

This follows the maintainer-directed package/state ownership split: root owns package replacement; the service owns state at boot. The branch occurs before update state setup and reuses openclaw#206343's installation/unit identification, the existing staged package installer, and the blocking systemctl owner. A state-free `runuser ... <recorded runtime> --version` probe runs as `User=` before replacement, with a sanitized launch environment; failure or an incompatible version refuses with its cause and next step. No service-controlled runtime is executed as root. The manual-procedure shell formatter and its obsolete tests are removed; shipped-candidate and non-root cross-account state checks remain refused, with a working documented manual recovery route for older installed updaters.

Scope boundary: the remaining frozen bridge state readers are not migrated or orchestrated here; they stay for their shipped contracts until the first-hop floor permits bridge deletion. launchd, Windows, and single-account update paths are unchanged.

Thanks to @fuller-stack-dev for openclaw#206343's system-account identification and openclaw#207230's 33-line `src/daemon/systemd-service-account-command.ts` helper. The original helper functions and synchronous argv API remain unchanged at the same path. The only addition is a 23-line NSS login-name resolver: systemd accepts numeric `User=1001`, but `runuser -u` requires its login name. None of openclaw#207230's bridge orchestration is inherited, and its branch remains untouched. The helper contribution is credited with the verified GitHub noreply co-author trailer.

Author pr-simplify completed: one reused identification and package operation, no new persisted records, statuses, phases, leases, notices, retries, flags, or triggers. Against `5d0834dfe163`: production net **+227 lines**, test net **+189**, docs net **+23**. The positive production net is the complete package/runtime-check/restart operation replacing a refusal, plus the command helper and numeric-account resolution. No state-maintenance or bridge orchestration is added.

## Evidence

- Red on the unchanged main source (`5d0834dfe163`): the new real `updateCommand` boundary regression reached the forbidden root state-setup tripwire instead of replacing the package/restarting the unit.
- Final head `18627bcd4b65641eb80a69a774b3e0d01a97ae6c`: source regressions passed with the repository wrappers under both the pinned Bun fork (11 tests) and Node (21 tests including candidate admission), 94.11 s combined wall time. The earlier full focused selection, including unchanged `src/update/cli.test.ts`, passed 64 tests on `c8bd81b367df0fd02389453b6cc54eea7d755207`.
- Scoped Oxfmt and type-aware Oxlint checks pass on the three repaired files (19.71 s); earlier scoped formatting and lint cover the unchanged files.
- Unit proof covers default root state and explicit service-state selectors, account-isolated version-probe argv/environment, numeric UID-to-login resolution and mismatched NSS rejection, incompatible recorded Node and exact probe failures before replacement, blocking restart completion, restart failure/inactive units, and `--no-restart`. Package installation, NSS lookup, the version-probe subprocess, and native service operations are mocked at their existing I/O boundaries; this is not live systemd proof.
- No existing system-unit-with-`User=` proof harness was found. `ci-published-driver-update.yml` / `scripts/e2e/lib/upgrade-survivor/native-systemd.mjs` uses `systemctl --user`, not system units. No hosted container run is claimed. Proof is unit tests plus PR CI.
- Full builds/type checks are left to hosted CI per the host constraint. First-head CI: https://github.com/openclaw/openclaw/actions/runs/46119231572 — architecture failed on the untouched `ui/src/pages/skill-workshop/action-presentation.ts` ↔ `skill-workshop-page.tsx` Madge cycle; runtime import-cycle and Kysely checks passed.
- Prior-head CI (`6804c4623254ca899dcab5d01f794f2f58ae3057`): https://github.com/openclaw/openclaw/actions/runs/46120628365 caught a fixture bug: its Bun shard made `process.execPath` describe a Bun service, so the intended Node-engine refusal did not apply. The fixture now records `/usr/bin/node` independently of the runner, preserving every refusal assertion. The two unnecessary deferred type arguments were also removed. Final-head CI is pending; no local full build or third review is claimed.
- Local ClawSweeper completed two rounds. Its TLS/legacy-recovery findings and then its service-runtime/queued-restart findings were repaired. The latter now uses the maintainer-approved state-free account probe and blocking systemctl restart. No third review is claimed; the package-only/no-root-state contract and unit+CI proof scope are the maintainer-selected direction.

Related: openclaw#204775, openclaw#206343. No release branch changes.

Co-authored-by: Jason (Json) <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 29, 2026
…205987)

## Class: completion is published before required maintenance finishes

Fleet run `4de610c8-e63d-4336-8e85-a76379cfd934` committed and served the new core, but its completion notice preceded the failed plugin result. The bug is ordering, not the core's status.

The modern Gateway-ready owner now settles once **after** required plugin work and sends one final notice afterward. A failed plugin remains a failed step, not a failed core update or a rollback trigger. Existing CLI following and capability-consent behavior remain; the failed-status/early-exit/backoff experiment is removed.

CLI completion, status, Doctor history and the Control UI reuse the existing `renderUpdateRunSummary` over recorded facts. Running results keep their phase; succeeded results name the installed after-version; skipped results keep their existing reason headline, never a guessed serving state. Failed work names its step and exact recovery command. Startup refusal diagnostics, structured failure facts, rollback compensation reasons, recorded signal output and profile-specific recovery commands remain visible. Existing discriminators distinguish repair and reconciled-history records from core updates. Background completion never rewrites the shared trial, preserving a newer pending trial and restart resumption.

## What this deletes

- `renderUpdateRunReport`, its private recovery hints and cause module.
- Routine Markdown completion publication/refresh, automatic `reportPath` output, and artifact-only admission/options plumbing.
- Obsolete completion-export tests and renderer-only assertions. Ledger, recovery, authority, privacy and step-detail assertions remain on their retained data owners.
- The abandoned failed-status classifier, campaign/retry exceptions, early-return CLI path and associated UI/test allocation.

**Kept deliberately:** explicit consent-gated **Report update failure** GitHub preview/submission, its reservation/receipt authority and sanitized issue artifacts. The remaining `update-failure-report*` code serves that user feature and triage, not routine completion. Identity/recovery and legacy result/sentinel projections remain because those manual-report and sentinel consumers still use them.

No new status, state store, flag, stored-record shape or launcher format.

## Size

`tokei` on this PR's **20 production files**, excluding tests/support/harnesses, against integrated main `6ac896f4cbb8bc29940c625cb1e2b19990e87284`:

| | Before | After | Net |
| --- | ---: | ---: | ---: |
| Production code lines | 7,758 | 7,148 | **−610** |
| Test/support lines | | | **−1,257** |

## Verification

- The earlier base Gateway-owner regression exposed the premature terminal write before plugin settlement. Final owner tests pin delayed settlement, unchanged successful core status, exact plugin recovery, one acknowledged final notice, newer-trial preservation and restart resumption.
- **Earlier focused AWS replay GREEN:** nine observed prepare/status/progress regression cases passed in99s; core and CLI-update types, scoped lint (zero warnings/errors) and format passed. https://crabbox.openclaw.ai/portal/runs/run_e5a8682ccf98bb7765b9d075be801705 . Exact qualified source was `5c6686ad20f50377f6affdec0d948f362dc37851`, tree `5ed1cb6e544fbd93604eea566b550f0c722842c8`, normal carrier `d2821086c00e55c8de35d00d7a4418168ca25a2d`; lease released with `--wait`. This is not claimed as an exact-head run after the later shared-summary/UI refinements.
- **Final pushed head:** `79182af301a6166914840dab9a705f4fa5c72fbd`. Restores the existing installed-runtime admission receipt before stop-and-repair advice, keeps historical summaries informational, and types the captured handoff notice without weakening assertions. Three requested files passed once: guidance32/32, handoff19/19, UI view15/15 (**66/66**). https://crabbox.openclaw.ai/portal/runs/run_ea4006e0b21e09bfbd763abe6e25929a . Qualified source was `985dd796d1` plus those two frozen restores, tree `45fe9f49c964b39806b431cde018432ed6e472fc`, normal carrier `81d874a77bb7de2f72307cca91f827db71ec7850`. Exact AWS lease released with `--wait`, exit0. Final-head CI remains the landing gate.
- **Repair candidate:** `1f223e15a20a04a27a4f745af81fb11b106d9d40`. Plain integrated main `6ac896f4cbb8bc29940c625cb1e2b19990e87284` passed all39 CLI tests on hydrated AWS4CPU/7730MiB, including the #205898 restart-wire case in31ms: https://crabbox.openclaw.ai/portal/runs/run_97637e77b460fbb7176bd261693cabd1 . B's timeout came from its local ledger fixture using a remote run ID; the fixture is corrected without changing main's captured connection contract.
- **Node regression batch:** nineteen files on repair predecessor `eede`, 481passed/4failed/1skipped; core types, scoped lint and format passed. https://crabbox.openclaw.ai/portal/runs/run_fbcf26ce68d5a5a539f63f6ee793237a . The four residuals were an early-return saved-notice recognition bug, two assertions pinning retired reconciled wording, and a native-refusal assertion reading a clipped excerpt instead of its retained structured cause. All are corrected without changing generic ledger storage.
- **Final-head residual proof:** summary18/18, abandoned-repair rows2/2 and native-start refusal1/1 passed; core and CLI-update types plus scoped format passed. https://crabbox.openclaw.ai/portal/runs/run_f4e633ac557bce484d1939c03cf88b3f . Source tree `9112e46c2b3081aab02b3dc9a0dfc1e0c06da55f`, normal carrier `82470c4669b7cc502049fa978dc5ed37defb6c6a`, AWS4CPU/7730MiB. Scoped lint did **not** run: its normal SDK declaration preparation failed first with TypeScript/vscode-jsonrpc `ERR_STREAM_DESTROYED`. No retry or bypass; current-head CI remains the lint gate.
- Historical failed-status screenshots, broad partial qualification and prior reviews describe the superseded design, **not** this head.
- No new upgrade source, death proof, harness test or Linux product campaign is added. Superseded remote proof jobs were cancelled and all their leases released with `--wait`.
- The ready-time settlement owner tests passed on integrated `9aba`: `gateway-trial.test.ts`18/18. Later output refinements do not change that settlement policy. Frozen `01b` UI reproduction observed unit14pass/1fail and E2E8pass/2fail. On repair predecessor `eede`, unit15/15, UI/pages/E2E types and scoped lint/format passed. Final `f087` passed both changed E2E cases (standalone repair history; warning advice and keyboard-accessible output), UI/pages/E2E types, scoped lint and format: https://crabbox.openclaw.ai/portal/runs/run_13701071e15057d5ac5c4ac5e927c65d . Source tree `3c734ef709a186303996517ecad54c5e5d4a0e9c`; exact lease released with `--wait`. The other8 E2E cases passed on `eede` and were intentionally not repeated.
- **Accepted budget cost:** exact `1f223` CI measures chat boot gzip **1,336,500→1,337,028 (+528 B)**, requests21→21; startup+1 B. Base already exceeds its cap, so normal tolerance is64 B (464 B excess). https://github.com/openclaw/openclaw/actions/runs/45885636780/job/140136424955 . Cause: `update-run-projection.ts` synchronously imports the shared summary for the existing card/view projection; the existing async result boundary already imports it dynamically. Ayaan accepted this cost for this PR through Main; no new async plumbing or budget config. Main applies the performance-only override at merge; every other gate remains required.
- **Final-head budget receipt (`79182`):** chat boot gzip **1,336,744→1,337,247 (+503 B)**, requests21→21; startup+1 B, normal tolerance64 B. https://github.com/openclaw/openclaw/actions/runs/45895112042/job/140167696819 . This is below the accepted predecessor's +528 B cost; same synchronous-summary cause, no new plumbing/config. Remaining CI gates are still pending.
- **Latest pushed head: `be86da0464892c10cbe7207ff98228eb1e81758a` (test-only delta).** The shared notice mock uses its production signature; no cast or weakened notice assertion remains. Healthy final recovery without an installed-runtime admission receipt explicitly expects update-again/no-stop advice. Two affected files passed once (**81/81**: handoff19, post-update62), focused Gateway/CLI-update types and lint passed: https://crabbox.openclaw.ai/portal/runs/run_c8784e2fe001772ae88bae53af8d9747 . Qualified source was `79182` plus the frozen test edits; only generic-type wrapping changed mechanically afterward, normal commit hooks passed. No production/budget change.
- The prior ratchet failure is infrastructure: its GitHub annotation says the hosted runner lost communication, leaving the baseline-ratchet step without a verdict. Its log fetch returned BlobNotFound/404. No old-head rerun was accepted or needed; this head's normal CI runs the ratchet again.
- **Latest pushed head: `bf3ab61efbb9dba856bfc4d651c7fc77f44549f2` (one exact-copy test assertion).** Requested same-guest owner-file comparison: plain main `993d0b77`13/13 passed ([run](https://crabbox.openclaw.ai/portal/runs/run_4983803c6c82c64295d7d513ac8b52cd)); `be86`12/13 passed ([run](https://crabbox.openclaw.ai/portal/runs/run_51b38ba2049d66bdf6437b89731bf787)), failing only the expected generic details tail. The actual last notice correctly preserves `commands.restart=false` and its app/operator remedy. This commit changes only the exact expected string, retaining acknowledgement, no-update and last-call/context assertions; no mock runtime or production change. No extra local rerun: new-head CI verifies the migrated expectation.

Co-authored-by: Ayaan Zaidi <[email protected]>

(cherry picked from commit ed8b883)

Release adaptation: Port Gateway run/notice timing and the existing maintenance result contract only; retain beta.2 CLI, Doctor and UI summary surfaces and explicit failure reports. Fold in #208074 abort/grace follow-up where applicable.

Later same-path commits from the pinned scan (separate behavior unless named as folded/selected below): 974d792 fix: keep update status quiet and app-managed updates honest (#208359); 186e941 fix: restore the dependency check on main (#207741); dae01a9 fix: keep other agents running when one store is refused (#208364); c9f7a98 fix: keep container Gateway commands from rolling back host updates (#208271); edb6820 fix: let the Gateway restart while boot plugin maintenance is running (#208074); bb37856 fix: keep Windows WebChat connected during config reloads (#208109); 516166c fix: exit once when gateway run rejects an argument after an update (#208068); 07e96dc fix: restart the Gateway after real plugin repairs (#208207); bd48ff6 fix: avoid restarting the Gateway for plugin timestamp changes (#208119); 259f71c fix: stop Linux service starts from copying the whole agent database (#207969); 7cb8975 fix: keep forked Claude chats separate after a Gateway crash (#208048); 6d300d3 fix: restart launcher-managed Gateways after exit 78 (#207972); 90ff668 fix: stop treating limited access as an Inbox alert (#207737); ec39a90 fix(whatsapp): retain sender for explicit current-message reactions (#190121); 86ca412 fix: show the saved quota reset when chat skips its only model (#207210); c4a675f fix: avoid reloading unchanged plugins after Gateway boot (#207949); 13c67a1 fix: let updates back up deeply nested databases (#207756); e2fcd4d fix: acknowledge updates when the Gateway first becomes ready (#207819); 8933edd fix: name safe recovery when agent schema markers disagree (#207705); 19e9dd6 fix(gateway): keep Linux legacy lock recovery explicit (#207340); 54b5989 test(update): move startup diagnostics to the live CLI (#207589); fbf1aae fix: give safe update ownership guidance and restore legacy result delivery (#207640); 0cbe433 test(gateway): move update admission tests to the current handler (#207545); a922203 refactor(update): remove native post-activation Doctor subprocess (#207585); c72bd9a fix(anthropic): show Claude CLI quota usage from the native login (#207543); 7ac87ad fix: avoid taking service-account ownership during updates (#207563); b3902a2 fix(update): allow in-place updates without a full state copy (#207448); 9fa8d14 refactor: trim redundant gateway test journeys (#207311); 2cf1cb6 test(cli): remove unused private fixture state (#207431); ece7a74 improve(workboard): apply the Control UI glossary and style to Workboard copy; 1c89587 fix: update system service packages without root state changes (#207304); dfd17d0 fix(docker): avoid pre-boot Doctor delays on container recreation (#207200); b616036 refactor(subagents): simplify ACP spawn relay ownership (#207023); 93ca762 improve: reduce allocations when preparing session rows (#207109); adb3716 fix(update): surface boot plugin repair advisories (#207163); f79ef8c fix: finish updates of 2026-11-17 main checkouts automatically on Linux and macOS (#207062); 3c4362b fix(update): preserve exception causes in failure history (#207085); 20c92a4 fix: converge plugins after every Gateway boot (#206926); 3078862 fix(update): clean up rejected Git update worktrees (#207040); 9993328 refactor(subagents): simplify kill claim and ownership handling (#207025); 97815bd refactor(subagents): consolidate registry cleanup and publication guards (#207064); e94f799 refactor(subagents): centralize requester turn matching (#206584); 819935f refactor(test): trim unused plugin fixture setup (#206982); 8ae0874 improve(gateway): avoid redundant cleanup for empty legacy auth stores (#206867); 4849bb7 fix(browser): report crashed tabs as tab-scoped failures (#194682); ea77ca3 refactor: report update failures from recorded runs (#206700); b19387e fix(test): cover SIGBREAK during pending update recovery (#206860); 18e53d8 fix: finish Linux upgrades after a legacy Gateway crashes (#206530); 8bd1863 chore(test): remove unused plugin contract fixture setup (#206812); f1841bc fix: stop repeating unchanged session state in every chat turn (#206766); f9a8f18 fix: clear the update warning after a retired model is repaired (#204778); 4d7e00b fix: let started participant runs and requests finish after an access change (#206747); 35cd392 improve: use less memory when waiting for an agent reply (#206733); 9845bf5 fix(test): keep readiness abort fixtures alive until stopped (#206660); 461f650 fix(ci): keep startup helpers internal (#206649); f89ae43 refactor(subagents): use cleanup and terminal owners in sweeps (#206533); a882e0f fix(agents): preserve task answers when sessions are reused (#126263); ccb6d81 fix: finish core updates when the Gateway is ready (#206560); 74f02b4 fix: refuse root updates of a system service that runs as another account (#206343); 01032b1 fix(update): keep acknowledged run IDs when status is unavailable (#206562); 3ce0582 refactor(subagents): centralize collector replay decisions (#206471); c2cfab0 chore: consolidate repeated test fixtures and guards (#198739); 219b6b0 perf(agents): render the system prompt from one manifest and halve it (#206537); 360e306 refactor(test): remove mocked outbound staging fixtures (#184863); cbdd907 fix: finish release updates after a slow launcher response (#206503); 81fc833 refactor(subagents): own dormant child Stop decisions (#206479); 91d4912 fix(update): stop using foreign recovery records as admission (#206295); 6feeb50 fix: stop 2026-11-17 main Git checkouts from half-switching on a schema update (#206341); be3c73e fix(subagents): finish claimed stops after session rotation (#206405); 5e5bb6e fix(update): round status inspection timeouts (#206250); 41afc0f fix(update): keep successful plugin reload warnings advisory (#206372); 6d86389 fix: finish healthy Git updates after an older verifier exits; da6ec1a fix(update): bound release CLI Gateway waits (#206252); d9a36b3 improve: skip unrelated harness discovery for isolated model calls (#206323); bcdb2ef improve(cli): skip channel and web discovery for model credentials (#206240).
Later PR-number mentions: none Later commit-SHA mentions: none
Pinned PR grep: ed8b883 fix(update): settle after plugins and share one completion summary (#205987)

Co-authored-by: RomneyDa <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 29, 2026
## Class: foreign updater records must not grant admission

Instances: #203486, #205736, #203917, and the modern release route refusing an old unfinished recovery.

The release preparation owner now takes its existing lock, checks the installation and physical restore guard, then records other unfinished runs as `failed: interrupted` and continues. It preserves its current run and the serving trial's handed-over run. The bounded drain reads current rows, not an enclosing Doctor snapshot.

In modern release preparation, the two recovery refusals remain: a positively live in-place lease holder, and `.openclaw-restore-*` that may contain the original state. Current modern locks/trials and normal preflight still apply.

## What disappears

- The 808-line interrupted plugin-cohort settlement owner, its run/finalize/repair discovery and replay paths, and obsolete killed-driver/death-proof suites.
- Foreign saved-row permission for plugin peer links, snapshot collection, interruption/reconciliation and terminal capture. Foreign cohort rows remain unchanged; another update does not replay their rollback.
- The critical-path retained-runtime census and its timeout branches. Existing owned-release path collection runs after ready; Doctor retains its separate old-runtime cleanup.
- Current mutation and Gateway completion read only their named pair. Main's existing all-row admission reader is retained only by the shipped package-finalization bridge, as the accepted fallback below.

Current source/executor/lifecycle/transaction/finalizer checks remain. Explicit repeated repair uses its existing abandonment and exclusive-ownership checks, not a foreign stored-recovery veto; it does not replay the saved cohort. Snapshot collection defers only inside this operation's existing live publication capture, preserving its rollback bytes without consulting foreign records. The shipped `finishInterruptedUpdate` export keeps its real staged finalization, pinned as a source build entry because the compatibility inventory names it.

No new state, flag, timer, death proof, schema/stored shape, or launcher/Gateway protocol change. Doctor-compatible reads remain for legitimate current cross-build bookkeeping, not foreign admission.

**Accepted legacy edge:** package-only finalization retains main's `recoveryAdmission` worker, coherent facts and assertion on its selected service/history roots. The schema-refusal/copy-cost cleanup is not redesigned here. Ordinary readiness guards keep their original no-recovery early return; modern release admission remains physical-only.

## Size

`tokei` on this PR's 39 runtime source files, excluding tests/support/harnesses and fixtures, against merged main `1e6d3f9bd9ecdbb061908ed30090bcf2fd6d7c2f` (original before-code base: `5c815265d5281c7929ab7483bd4e471e54e5c0ff`):

| | Before | After | Net |
| --- | ---: | ---: | ---: |
| Production code lines | 11,335 | 10,362 | **−973** |
| Test/support lines | | | **−2,447** |

Tooling routing/inventory and the update implementation contract are updated with the cut; their deletions are not counted as runtime savings.

## Verification

- Current head `b4e588ff5f9e35a27faa20232819c7f73e100d4a`, tree `12b76c0debe4b9b4ee2274c3459acce54acc1c3d`, fixes the landing review's lease-permission regression: slot inspection opens through the existing lease-store preparation owner, not direct identity capture. The existing slot table now covers an idle owned `0644` store being repaired to `0600` without refusing admission or changing history. Normal hooks passed; **current-head CI is pending**. Predecessor `63010e7d0af9` completed 87 successful checks with no failures/pending checks, including schema, copy-cost, healthy-caller, type, lint, ratchet and extension-boundary gates ([run](https://github.com/openclaw/openclaw/actions/runs/45952703299)).
- Corrected AWS Linux base proof: seven selected contracts, **six meaningful failures and one terminal-history control pass**. A pre-repair repeated-repair comparison selected two positive cases; both failed meaningfully. This supersedes the initial host-only baseline, which is not counted as Linux proof.
- AWS `747bd654fa01`: **145 passed, two skipped** across nine files; core/core-test/scripts/tooling types, changed lint/format and dead-export scans passed. AWS `9901b03a6ae4`: **132 passed** across six affected files, including real snapshot rollback and CLI deadline integration; core/core-test types, scoped lint/format and dead-export scans passed. [Final run](https://crabbox.openclaw.ai/portal/runs/run_95deb2b3c2b56df85ff53e839750f5c5). These are qualified source snapshots, not exact `2dfc213fbdc6` proof.
- The final local identity ratchet could not resolve the original base object after normal synthetic-source sync; that is a setup gap, not a policy verdict. Current CI owns the ratchet and the later two-root schema repair. Both owned AWS leases were released with exact `stop --wait` receipts; no paid resource remains.
- Predecessor `63010e7d0af9` passed the Linux published-to-head [`docker-seed-e2e` / `release-update-survivor` lane](https://github.com/openclaw/openclaw/actions/runs/45952703299/job/140352861920) in 2,615 seconds; healthy/crash/downgrade receipts are artifact 15179778195. Latest-head CI remains the landing gate. The standalone fixture-kit producer remains unsupported unchanged on AWS Linux because it requires Studio/macOS-only ocx cloning; no kit patch, host build, shim or separate paid campaign was used.
- Two local review rounds completed. The first review's request to restore foreign cohort settlement is [explicitly rejected](#206295 (comment)) under Ayaan's rule; its concrete repeated-repair case, build reachability and real path-state testing concerns are addressed. The second review's current-operation snapshot-retention finding is fixed through the existing live capture, not a foreign-row permission check. The maintainer reviews only this final delta.
- The active-list query now excludes the two protected named rows before its limit; `run.ts` has no ID comparisons and the identity allowlist does not grow. Four CI failures that asserted the deliberately retired foreign-record refusal were removed or migrated while retaining current-operation, service-profile and saved-evidence assertions.
- `47d896edda06` passed the two split-root schema cases but added a second snapshot on the common readiness path (`update-command-recovery-cost.test.ts:77`). Per maintainer direction, the move is reverted and main's admission is retained only for package finalization. Both schema assertions and the copy-cost assertion remain unchanged. Current reporting refusal remains; only the retired global-malformed-row policy tail is deleted. Current CI owns the fallback's qualification; earlier AWS snapshots do not prove it. Runner-shutdown ratchets and WebKit apt 403 were infrastructure failures, not product verdicts.
- Maintainer landing review and latest-head CI remain required; no worker merge performed.

Co-authored-by: Ayaan Zaidi <[email protected]>

(cherry picked from commit 91d4912)

Release adaptation: Port the modern release preparation admission boundary only: retain the published package updater’s existing recovery contract, check live in-place custody and restore directories, interrupt only unowned run history, and preserve beta.2 release/runtime cleanup outside that boundary. No schema or row-shape changes.

Later same-path commits from the pinned scan (separate behavior unless named as folded/selected below): f84b705 fix: preserve lower-token guidance for unaffordable requests (#201392); dae01a9 fix: keep other agents running when one store is refused (#208364); a20fd1c fix: avoid competing Gateway test boots and cold agent mutation imports (#208203); c9f7a98 fix: keep container Gateway commands from rolling back host updates (#208271); edb6820 fix: let the Gateway restart while boot plugin maintenance is running (#208074); 516166c fix: exit once when gateway run rejects an argument after an update (#208068); 07e96dc fix: restart the Gateway after real plugin repairs (#208207); 13059ef fix: keep the PostgreSQL Doctor preflight test from timing out on module loading (#208225); 50d7708 fix: keep Claude fork compaction out of the parent chat (#208192); bd48ff6 fix: avoid restarting the Gateway for plugin timestamp changes (#208119); 259f71c fix: stop Linux service starts from copying the whole agent database (#207969); 7cb8975 fix: keep forked Claude chats separate after a Gateway crash (#208048); 407b523 fix(slack): thread queued DM replies under the triggering message (#208133); 43b5b52 chore(release): close out 2026.11.11 on main (#208114); 5d5284c fix(ci): add tagged reply control to the PR wrapper inventory (#208120); 1782ab0 fix: keep confirmed sends in the receiving chat's model history (#208049); 6d300d3 fix: restart launcher-managed Gateways after exit 78 (#207972); c4a675f fix: avoid reloading unchanged plugins after Gateway boot (#207949); 13c67a1 fix: let updates back up deeply nested databases (#207756); e2fcd4d fix: acknowledge updates when the Gateway first becomes ready (#207819); 8933edd fix: name safe recovery when agent schema markers disagree (#207705); 19e9dd6 fix(gateway): keep Linux legacy lock recovery explicit (#207340); 3256a47 test(update): move package ownership coverage to preparation (#207581); fbf1aae fix: give safe update ownership guidance and restore legacy result delivery (#207640); a922203 refactor(update): remove native post-activation Doctor subprocess (#207585); 7ac87ad fix: avoid taking service-account ownership during updates (#207563); b3902a2 fix(update): allow in-place updates without a full state copy (#207448); ece7a74 improve(workboard): apply the Control UI glossary and style to Workboard copy; 1c89587 fix: update system service packages without root state changes (#207304); dfd17d0 fix(docker): avoid pre-boot Doctor delays on container recreation (#207200); b616036 refactor(subagents): simplify ACP spawn relay ownership (#207023); 93ca762 improve: reduce allocations when preparing session rows (#207109); adb3716 fix(update): surface boot plugin repair advisories (#207163); f79ef8c fix: finish updates of 2026-11-17 main checkouts automatically on Linux and macOS (#207062); 3c4362b fix(update): preserve exception causes in failure history (#207085); 539f37f perf(gateway): keep legacy lease inspection out of heartbeats (#207084); 7a20389 fix: preserve source ranges in compaction requests (#207045); 20c92a4 fix: converge plugins after every Gateway boot (#206926); 3078862 fix(update): clean up rejected Git update worktrees (#207040); 73cb180 improve: reduce peak memory during Gateway startup update checks (#207073); 9993328 refactor(subagents): simplify kill claim and ownership handling (#207025); 97815bd refactor(subagents): consolidate registry cleanup and publication guards (#207064); 49c5e3e fix: let the end-of-turn recovery request reuse the turn's cached prompt (#207052); e94f799 refactor(subagents): centralize requester turn matching (#206584); e2e0974 fix(doctor): skip the state schema repair when its read-only plan finds nothing (#206694); 15e840e fix(ci): clear stale restart-sentinel exports from the dependency report (#206911); a72dcc9 fix(agents): resolve utility models against the session owner's role (#206962); 8ae0874 improve(gateway): avoid redundant cleanup for empty legacy auth stores (#206867); af1f26c improve: avoid unused proxy runtime in local text replies (#206931); 179e0c4 fix: label conversation data in system updates; ea77ca3 refactor: report update failures from recorded runs (#206700); 18e53d8 fix: finish Linux upgrades after a legacy Gateway crashes (#206530); f0e7d96 fix: preserve large snapshots in trajectory exports (#206810); c7ea9f4 improve: reduce memory used to renew state leases (#206798); 4d7e00b fix: let started participant runs and requests finish after an access change (#206747); dff00f3 fix(mcp): bound unavailable server notices in each turn (#206318); 9845bf5 fix(test): keep readiness abort fixtures alive until stopped (#206660); 844bfbf improve(build): trim unused imports from standalone relays (#170187); d4d45a7 improve: reduce memory when reading saved credentials (#206686); 461f650 fix(ci): keep startup helpers internal (#206649); f89ae43 refactor(subagents): use cleanup and terminal owners in sweeps (#206533); a882e0f fix(agents): preserve task answers when sessions are reused (#126263); 5c5f629 perf(config): keep update inspection out of ordinary config reads (#206607); ccb6d81 fix: finish core updates when the Gateway is ready (#206560); 74f02b4 fix: refuse root updates of a system service that runs as another account (#206343); 01032b1 fix(update): keep acknowledged run IDs when status is unavailable (#206562); cbdd907 fix: finish release updates after a slow launcher response (#206503); ad676f4 improve: reduce memory used by Gateway ownership checks (#206516); 81fc833 refactor(subagents): own dormant child Stop decisions (#206479).
Later PR-number mentions: `ccb6d8168658` fix: finish core updates when the Gateway is ready (#206560), `ea77ca3d602c` refactor: report update failures from recorded runs (#206700) Later commit-SHA mentions: `238c6daf2ba6` perf: import llm-core types from their leaf entry (#206518), `ccb6d8168658` fix: finish core updates when the Gateway is ready (#206560)
Pinned PR grep: ea77ca3 refactor: report update failures from recorded runs (#206700); ccb6d81 fix: finish core updates when the Gateway is ready (#206560); 91d4912 fix(update): stop using foreign recovery records as admission (#206295); 41afc0f fix(update): keep successful plugin reload warnings advisory (#206372)

Co-authored-by: RomneyDa <[email protected]>
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 gateway Gateway runtime impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: L status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant