Skip to content

fix(update): report unavailable systemd inspection without a false recovery failure - #175928

Merged
steipete merged 1 commit into
mainfrom
upd/upd-l1679
Oct 18, 2026
Merged

steipete merged 1 commit into
mainfrom
upd/upd-l1679

Conversation

@steipete

@steipete steipete commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

An update refused before changing its managed Gateway could report a false recovery failure, while unavailable systemd inspection discarded the native cause needed to diagnose it.

Refs #175869. The reporter's Pi root cause remains unknown until its native diagnostic is collected.

User Impact

An untouched managed-service refusal records No recovery needed; still serving <before> (or honestly reports the unchanged installation when no running observation exists), without a restart-unhealthy verdict. Existing refusal messages and failure facts retain the failed probe, exit/termination, and a sanitized first stderr line, together with the unchanged-installation and inspection guidance.

This does not make every unavailable-inspection path refuse safely: the live proof below exposed an existing admission gap, which remains outside this explicitly narrowed patch.

Why This Change Was Made

The native execution owner keeps the bounded diagnostic in the existing inspection error; the existing runtime detail and managed-service failure facts carry it. The recovery owner skips restart verification when nothing was stopped, started, or changed. The failure-fact formatter is consolidated rather than duplicated.

No added retry, process-owner fallback, diagnostic propagation object, option, schema, or dependency. Existing inspection deadlines and user-bus derivation remain unchanged. Production +115/-76 = net +39; tests +126/-27 = net +99, relative to bbd73bc442f4. The remaining production growth is native diagnostic capture/formatting and the untouched-recovery condition.

Evidence

  • Native show/cat/is-active diagnostic regressions, untouched recovery, and lost-inspection guidance failed on the untouched base. The deadline regression also failed because the native probe cause was lost.
  • Final focused run: 187 tests across six owner suites passed, three Vitest shards in 55.46 s. Both refusal codes, native causes, preserved public refusal facts, existing absence/ownership classification, and lost-inspection guidance passed.
  • The required 168-file importer sweep completed in 31 m 22 s: 2,905 tests passed, 30 existing skips, five assertion failures. It caught an obsolete signal-message expectation and four cases where diagnostic facts replaced the public refusal fact. The public fact is now preserved and diagnostics appended; the five cases passed in the final owner-suite replay. The other passing results were reused because their behavior was unchanged.
  • Targeted CLI/services run-tsgo.mjs checks, touched-file oxlint/oxfmt, git diff --check, and Madge passed (0 cycles). Final runtime build passed in 80.6 s; packed-package integrity passed. SQLite inventory was skipped under the campaign's local gate budget; PR CI owns broad checks.
  • Independent Codex review found no actionable P0/P1 issues.
  • Pre-existing slow fixtures: update-command-original-service.test.ts spent 180.6 s across 48 cases (maximum 10.7 s); update-command-database-rollback.test.ts spent 177.6 s across 13 cases (maximum 24.5 s). Their retained-service and package/Git/database rollback fixtures repeat real setup per case; update-command-lease.test.ts also spent 144.1 s across 54 cases (maximum 6.7 s), repeatedly launching its fresh-process lease/Doctor fixture. These suites and their timeouts/assertions were not changed.

Live proof and limitation

The isolated package was built with pnpm build:runtime and packed with:

node --import ./scripts/tsx.mjs scripts/package-openclaw-for-docker.mts \
  --skip-build --output-dir "$PWD/.artifacts/l1679-final/live" \
  --output-name openclaw-base.tgz

Inside each isolated container, the principal commands were:

env -u XDG_RUNTIME_DIR -u DBUS_SESSION_BUS_ADDRESS timeout 180 \
  openclaw update --yes --tag file:/proof/openclaw-candidate.tgz
openclaw update status --json
openclaw gateway call health --json
openclaw gateway call themes.list --params '{}' --json

Both runs used a real built Gateway, isolated HOME/state, port 19879, a canonical fake systemd surface, and a locally packed 2026.10.5 candidate. The update command omitted XDG_RUNTIME_DIR and DBUS_SESSION_BUS_ADDRESS. One run made native probes unavailable initially; the other retained successful initial inspection and failed probes after candidate cleanup.

Neither run proved safe refusal. Both replaced 2026.10.4 with 2026.10.5 without a native stop/start/restart call. The installation observer requested a supervisor restart (gateway.installation_replaced), replacing the original process. The bounded commands ended at about 182 s with exit 137 while status still showed running / activating; a SIGTERM recovery message was observed, but there was no terminal refusal or recovery result. The precise cause of exit 137 was not established. HTTP health, health RPC, and a first themes.list call (11 themes) passed on the replacement processes, not on a retained old process. Both owned containers were removed.

Source diagnosis: the existing package guard requires an installation path from argv, but the Gateway rewrites its process title to openclaw-gateway; the native-exception path can also return unavailable before checking the retained service admission. Those decisions are unchanged by this patch. Matching PID/start-time/port/systemd-owner evidence was captured before the delayed run. This patch adds no new authority path and makes no claim to fix that separate gap.

The initial Bun worker SIGTRAP is a pre-existing intermittent native startup defect, tracked in #175961. Worker/launch/pinned-runtime blobs were unchanged; 600 minimal launches passed, establishing intermittence rather than a repair. No retry, timeout increase, or weaker assertion was added.

@clawsweeper

clawsweeper Bot commented Oct 17, 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.

@steipete
steipete marked this pull request as ready for review October 17, 2026 23:39
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T02:17:36.083134Z d69a80e New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime cli CLI command changes size: L labels Oct 17, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ce94653a94

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +48 to +50
!error.failureFacts.some(
(fact) =>
fact.check === "managed-service-runtime" || fact.code === "service-ownership-unverified",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Accept reason-coded systemd inspection failures

When systemd reports a real inspection failure such as systemd-user-bus-unavailable or systemd-inspection-deadline-exceeded, the runtime preserves that value as inspectionReason, and assertGatewayServiceAdmissionUnchanged produces a failure fact with check: "managed-service" and that reason as its code. This predicate accepts only managed-service-runtime or the generic service-ownership-unverified, so the new process-owner fallback is skipped for the concrete Linux failures it is intended to tolerate; only the reasonless test fixture reaches it. Accept reason-coded unavailable-inspection facts while continuing to exclude actual ownership-change refusals.

AGENTS.md reference: AGENTS.md:L82-L86

Useful? React with 👍 / 👎.

@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. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. 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. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 17, 2026
@clawsweeper

clawsweeper Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR retains native systemd failure details and avoids false recovery failures after an untouched update refusal.

Example: An update from 2026.10.3 is refused before stopping or changing the Gateway.

  • Before: Recovery can report restart-unhealthy despite the previous Gateway remaining running.
  • After: Recovery records that no recovery was needed and preserves the original refusal.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, focused repair with reported regression coverage, limited live coverage of the final scope, and unresolved diagnostic defects.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored diagnostic repair is outside the ordinary contributor proof gate and does not materially change authority; supplied live runs do not demonstrate its terminal refusal or recovery behavior.
Patch quality 🦐 gold shrimp (3/6) 4 actionable review findings remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: An update that leaves the Gateway untouched can falsely report failed recovery and omit the native inspection cause.
Reason: The reporting repair has clear operator value and maintainer-approved direction; retaining Related scope is appropriate because the reporter's underlying refusal remains unresolved.

Merge readiness

⛔ Needs changes before merge - 4 items remain

This PR addresses a real reporting defect and preserves existing ownership checks, but four diagnostic defects need correction before merge.

Priority: P2
Reviewed head: d69a80e612aea777420017b16ce775c5fe0fc55c

Before merge

  • Distinguish a missing busctl executable from an unavailable manager (P2) - On a system-scope Gateway with working systemd/systemctl but no busctl executable, readLoadedSystemdServiceRuntime calls execBusctlSystem and receives ENOENT. This new branch records service-manager-unavailable, so the report claims no supported manager exists and recommends manual restart instead of identifying the missing dependency. Preserve the executed-command distinction and classify missing busctl as systemd-busctl-unavailable, as systemd-command-query already does. This prior finding remains unresolved.
  • Keep shared refusal guidance platform and profile aware (P3) - When an admitted service becomes unavailable on Windows, macOS, or FreeBSD, this shared branch now directs the operator to systemctl --user, which is unavailable there. It also selects the wrong unit for profiled or system-scope Linux services. Retain the portable gateway status command or derive native guidance from the actual service target. This prior finding remains unresolved.
  • Use refusal-specific wording when appending inspection diagnostics (P3) - For an owned verdict that becomes unavailable before mutation, serviceUpdateVerdict.message includes GATEWAY_SERVICE_INSPECTION_WARNING, instructing the operator to restart manually after the update. Appending it here contradicts the unchanged-installation result and can prompt an unnecessary restart. Append the native diagnostic without the post-update warning. This is a late discovery: the same concern was equally visible at the previously reviewed d69a80e head, and the targeted comparison shows no code change.
  • Report the selected machine route in failed busctl probes (P3) - When session/runtime/private routes fail and discovery reaches a machine candidate, the actual command includes --machine <user>@ --user, but the recorded probe becomes busctl --user machine Manager.Version. That command was never executed and omits the selected manager target, defeating diagnosis of headless-user failures. Format the diagnostic from the existing scope and query arguments. This is a late discovery on the unchanged previously reviewed d69a80e head.

Findings

  • [P2] Distinguish a missing busctl executable from an unavailable manager — src/daemon/systemd-exec.ts:103-104
  • [P3] Keep shared refusal guidance platform and profile aware — src/cli/update-cli/update-command-service-plan.ts:103-104
  • [P3] Use refusal-specific wording when appending inspection diagnostics — src/cli/update-cli/update-command-service-plan.ts:104

Tests

  • Missing end-to-end proof: The supplied live runs never reached the untouched refusal and completed recovery report; reported baseline failures and owner-suite passes support that path only through tests.
Agent review details

How this fits together

The update CLI consumes native service inspections, checks admission, and records failure and recovery outcomes in update history.

flowchart TD
  A[Update CLI] --> B[Service admission]
  B --> C[Native systemd probes]
  C --> D[Inspection diagnostics]
  D --> E[Failure facts]
  B --> F[Recovery observation]
  E --> G[Update report]
  F --> G
Loading

Technical review

Best possible solution:

Keep the existing inspection and recovery owners, correcting command classification and context-specific guidance without adding fallback authority.

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

Source shows both the false recovery-verification path and the introduced diagnostic defects; no target code was executed during this review.

Is this the best way to solve the issue?

The narrowed approach uses existing owners and addresses the reporting invariant, but command identity and refusal-specific guidance need the corrections listed below.

Full review comments:

  • [P2] Distinguish a missing busctl executable from an unavailable manager — src/daemon/systemd-exec.ts:103-104
    On a system-scope Gateway with working systemd/systemctl but no busctl executable, readLoadedSystemdServiceRuntime calls execBusctlSystem and receives ENOENT. This new branch records service-manager-unavailable, so the report claims no supported manager exists and recommends manual restart instead of identifying the missing dependency. Preserve the executed-command distinction and classify missing busctl as systemd-busctl-unavailable, as systemd-command-query already does. This prior finding remains unresolved.
    Confidence: 0.99
  • [P3] Keep shared refusal guidance platform and profile aware — src/cli/update-cli/update-command-service-plan.ts:103-104
    When an admitted service becomes unavailable on Windows, macOS, or FreeBSD, this shared branch now directs the operator to systemctl --user, which is unavailable there. It also selects the wrong unit for profiled or system-scope Linux services. Retain the portable gateway status command or derive native guidance from the actual service target. This prior finding remains unresolved.
    Confidence: 0.99
  • [P3] Use refusal-specific wording when appending inspection diagnostics — src/cli/update-cli/update-command-service-plan.ts:104
    For an owned verdict that becomes unavailable before mutation, serviceUpdateVerdict.message includes GATEWAY_SERVICE_INSPECTION_WARNING, instructing the operator to restart manually after the update. Appending it here contradicts the unchanged-installation result and can prompt an unnecessary restart. Append the native diagnostic without the post-update warning. This is a late discovery: the same concern was equally visible at the previously reviewed d69a80e head, and the targeted comparison shows no code change.
    Confidence: 0.98
    Late finding: first raised on code an earlier review cycle already covered.
  • [P3] Report the selected machine route in failed busctl probes — src/daemon/systemd-user-transport.ts:187-188
    When session/runtime/private routes fail and discovery reaches a machine candidate, the actual command includes --machine <user>@ --user, but the recorded probe becomes busctl --user machine Manager.Version. That command was never executed and omits the selected manager target, defeating diagnosis of headless-user failures. Format the diagnostic from the existing scope and query arguments. This is a late discovery on the unchanged previously reviewed d69a80e head.
    Confidence: 0.99
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 4247e12bb83e.

Provenance checked

  • Unavailable-inspection failure facts keeps the original intent (b364477: Preserve canonical native inspection reasons instead of reporting ownership drift; this PR extends that intent to bounded probe details.)
  • Best-effort service inspection keeps the original intent (7d2933b: Continue when native inspection is unavailable without granting service mutation authority from unverified records.)
  • Recovery observation changes intended behavior with a stated reason (ec9f486: Avoid startup verification when no Gateway was expected; the PR explains extending this to untouched refusals.)
  • Native fallback and ownership failures keeps the original intent (68555b8: Keep unsettled native cleanup and observed ownership refusals fatal while allowing ordinary diagnostic fallback.)
  • Systemd transport deadlines keeps the original intent (0c91469: Exclude synchronous custody checks from inspection time accounting while retaining native deadlines and authority checks.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test src/daemon/systemd-unavailable.test.ts src/daemon/systemd-user-transport.test.ts src/daemon/systemd-loaded-runtime.test.ts --maxWorkers=1
  • pnpm test src/cli/update-cli/update-command-service-maintenance.test.ts src/cli/update-cli/update-command-service-unavailable.test.ts src/cli/update-cli/update-command-failure-recovery.test.ts --maxWorkers=1
  • Verify missing busctl with working systemctl, failed machine-route discovery, and unavailable revalidation on non-Linux and profiled Linux targets.
  • git diff --check

What I checked:

  • Pinned introduction and current-main context: The introduced diff contains diagnostic propagation and untouched-recovery reporting, without the earlier process-owner fallback; fetched main retains the base behavior in these owners. (src/cli/update-cli/update-command-failure-recovery.ts:101, d69a80e612ae)
  • Missing executable misclassification: execBusctlSystem now attaches service-manager-unavailable for ENOENT, and loaded runtime inspection consumes it; the existing command-query owner separately recognizes systemd-busctl-unavailable. (src/daemon/systemd-exec.ts:103, d69a80e612ae)
  • Shared refusal message: The cross-platform admission check hardcodes a default Linux user unit and appends a verdict containing post-update manual-restart instructions. (src/cli/update-cli/update-command-service-plan.ts:104, d69a80e612ae)
  • Machine-route diagnostic: Discovery executes busctl with --machine and the selected user, but its failure formatter records busctl --user machine Manager.Version. (src/daemon/systemd-user-transport.ts:188, d69a80e612ae)
  • Reporter evidence and partial scope: Update failure: gateway-recovery-verification (2026.10.3) #175869 establishes a released update refusal and inconsistent recovery reporting; its native inspection cause remains unknown.
  • Supplied behavior evidence: The body reports baseline-failing regressions and passing owner suites, but both live update runs replaced the package and ended without a terminal refusal or recovery result; they do not demonstrate the narrowed behavior. (d69a80e612ae)

Likely related people:

  • Peter Steinberger: Raw commit ccd3fbb adds src/daemon/systemd-user-transport.ts:53 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ccd3fbb9181e; files: src/daemon/systemd-user-transport.ts)
  • RoboClaw: Raw commit 0c91469 adds src/daemon/systemd-user-transport.ts:62 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 0c91469b2dab; files: src/daemon/systemd-user-transport.ts)

PR surface

Source +39, Tests +99. Total +138 across 21 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 12 115 76 +39
Tests 9 126 27 +99
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 21 241 103 +138

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: Incorrect update diagnostics and recovery outcomes create operator confusion without establishing an ongoing Gateway outage.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • 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.

History

Review history (3 earlier review cycles)
  • reviewed 2026-10-17T23:56:47.172Z sha ce94653a94b959af923288c04db12d0a49930c27 :: needs real behavior proof before merge. :: [P1] Preserve native ownership refusals before observing a fallback owner
  • reviewed 2026-10-18T01:09:29.952Z sha 9785a1e9764acfcdfe434cba04abdbc6713eafda :: needs real behavior proof before merge. :: [P2] Distinguish missing busctl from an unavailable system manager | [P2] Preserve restart guidance when unavailable inspection still allows updating | [P2] Complete the test cutover to Linux refusal semantics
  • reviewed 2026-10-18T02:16:05.420Z sha d69a80e :: needs changes before merge. :: [P2] Distinguish a missing busctl executable from an unavailable manager | [P3] Keep shared lost-inspection guidance platform and profile aware

Reviewed October 17, 2026, 10:22 PM ET / October 18, 2026, 02:22 UTC (Revision 4).

@steipete steipete changed the title fix(update): tolerate unavailable inspection of owned Linux Gateways fix(update): diagnose unavailable systemd inspection and keep refusals untouched Oct 18, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: XL and removed size: L labels Oct 18, 2026
@clawsweeper clawsweeper Bot added the clawsweeper:intake:bug Preliminary submission classification; full source review pending. label Oct 18, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9785a1e976

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/daemon/systemd-exec.ts Outdated
Comment on lines +132 to +138
if (
scope === "system" &&
result.termination === "exit" &&
readSystemctlDetail(result).includes("System has not been booted with systemd")
((result.termination === "error" && result.errorCode === "ENOENT") ||
(result.termination === "exit" &&
readSystemctlDetail(result).includes("System has not been booted with systemd")))
) {
return new ServiceInspectionError("service-manager-unavailable");
return new ServiceInspectionError("service-manager-unavailable", result.inspectionDiagnostic);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the missing-busctl diagnosis for system units

When inspecting a system-scope Gateway on a host where systemd/systemctl works but busctl is absent, readLoadedSystemdServiceRuntime calls execBusctlSystem, whose ENOENT result now enters this branch and is mislabeled service-manager-unavailable. The update consequently reports that the system manager is unavailable even though only busctl must be installed; distinguish the executed command here, as systemd-command-query.ts already does for the same failure.

AGENTS.md reference: AGENTS.md:L82-L84

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Oct 18, 2026
@clawsweeper clawsweeper Bot removed the clawsweeper:intake:bug Preliminary submission classification; full source review pending. label Oct 18, 2026
@steipete steipete changed the title fix(update): diagnose unavailable systemd inspection and keep refusals untouched fix(update): report unavailable systemd inspection without a false recovery failure Oct 18, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added size: M and removed docs Improvements or additions to documentation commands Command implementations size: XL labels Oct 18, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. 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 rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 18, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d69a80e612

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

throw new GatewayServiceUpdateOwnershipError(
serviceUpdateVerdict.kind === "unavailable"
? "Gateway service ownership could not be verified because inspection is unavailable. Run `openclaw gateway status --deep` and retry."
? `Gateway service inspection is unavailable. Run \`systemctl --user status openclaw-gateway\` and \`openclaw gateway status --deep\` before retrying.\n${serviceUpdateVerdict.message}`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep unavailable-admission guidance platform-specific

When service inspection becomes unavailable on Windows, macOS, or FreeBSD between admission and revalidation, this cross-platform branch tells the operator to run systemctl --user, which is unavailable there; it also hardcodes the default unit name for profiled Linux installations. Select guidance from the service platform/verdict instead of unconditionally prescribing this command.

AGENTS.md reference: AGENTS.md:L82-L84

Useful? React with 👍 / 👎.

throw new GatewayServiceUpdateOwnershipError(
serviceUpdateVerdict.kind === "unavailable"
? "Gateway service ownership could not be verified because inspection is unavailable. Run `openclaw gateway status --deep` and retry."
? `Gateway service inspection is unavailable. Run \`systemctl --user status openclaw-gateway\` and \`openclaw gateway status --deep\` before retrying.\n${serviceUpdateVerdict.message}`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Do not append post-update guidance to a pre-mutation refusal

When an earlier owned verdict becomes unavailable here, the update is refused before package mutation, but ${serviceUpdateVerdict.message} includes GATEWAY_SERVICE_INSPECTION_WARNING, which tells the operator to restart manually “after the update.” This contradicts the unchanged-installation recovery result and can prompt an unnecessary Gateway restart; append only the native inspection diagnostics or use refusal-specific wording.

AGENTS.md reference: AGENTS.md:L82-L84

Useful? React with 👍 / 👎.

},
);
if (result.code !== 0 || result.termination !== "exit") {
failure = formatSystemdProbeFailure(`busctl --user ${checking}`, result);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Report the actual machine busctl probe

When the fallback candidate is kind === "machine", the executed command uses busctl --machine <user>@ --user ..., but this records busctl --user machine Manager.Version, a command that was never run and that omits the selected manager target. Build the diagnostic from scope and the actual query arguments so headless-user failures identify the probe that failed.

AGENTS.md reference: AGENTS.md:L82-L84

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 18, 2026
@steipete
steipete merged commit 0e19fca into main Oct 18, 2026
171 of 178 checks passed
@steipete
steipete deleted the upd/upd-l1679 branch October 18, 2026 02:28
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 18, 2026
…covery failure (openclaw#175928)

When systemd service inspection was unavailable, the managed-service preflight refused with a generic 'service-ownership-unverified' message and recovery then reported 'restart-unhealthy' although nothing had been stopped or changed. The refusal now names the failed probe with its exit code and first sanitized stderr line plus the next command to run, and an untouched preflight refusal records that no recovery was needed and the previous version is still serving. Ownership policy is unchanged.

Refs openclaw#175869
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M 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