Skip to content

Doctor: expose systemd linger findings - #97514

Merged
giodl73-repo merged 7 commits into
openclaw:mainfrom
giodl73-repo:doctor-systemd-linger-lint-findings
Jul 5, 2026
Merged

giodl73-repo merged 7 commits into
openclaw:mainfrom
giodl73-repo:doctor-systemd-linger-lint-findings

Conversation

@giodl73-repo

@giodl73-repo giodl73-repo commented Jun 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add default-disabled structured lint findings for core/doctor/systemd-linger
  • keep legacy interactive/non-interactive linger enablement in the existing Doctor run paths
  • gate structured linger findings on the same loaded Gateway systemd service precondition as the legacy Doctor path, so --all/--only stays quiet on hosts without an OpenClaw systemd user service

Validation

  • node scripts/run-vitest.mjs run src/flows/doctor-health-contributions.test.ts --reporter=verbose (72 tests) on rebased head a39e27b668ee57f4ec3279bb9c6c739af7a3b3a9
  • git diff --check
  • Prior local validation on this slice:
    • ./node_modules/.bin/oxfmt --check src/flows/doctor-health-contributions.ts src/flows/doctor-health-contributions.test.ts
    • ./node_modules/.bin/oxlint src/flows/doctor-health-contributions.ts src/flows/doctor-health-contributions.test.ts
    • CI=1 PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=false node scripts/run-oxlint.mjs src/flows/doctor-health-contributions.ts src/flows/doctor-health-contributions.test.ts
    • node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfo
    • node --max-old-space-size=8192 scripts/plugin-sdk-surface-report.mjs --check
    • node scripts/sync-plugin-sdk-exports.mjs --check

Real behavior proof

Behavior or issue addressed:
Selected doctor --lint --only core/doctor/systemd-linger should not warn merely because local Linux linger is disabled. It should only report disabled linger when OpenClaw is actually running through a loaded Gateway systemd user service, matching the legacy Doctor path.

Real environment tested:
Crabbox brokered Linux VM, provider azure, lease cbx_6322dfa0e580, slug violet-shrimp, run run_2dd29a8828cc, target linux, machine type Standard_D32ads_v6. The host had real systemd PID 1, an active user systemd manager, openclaw-gateway.service enabled as a user unit, and loginctl show-user crabbox -p Linger returned Linger=no.

Exact steps or command run after this patch:

  1. Build source checkout with pnpm build.
  2. Create a harmless user unit at ~/.config/systemd/user/openclaw-gateway.service with ExecStart=/bin/sleep infinity.
  3. systemctl --user daemon-reload
  4. systemctl --user enable openclaw-gateway.service
  5. systemctl --user is-enabled openclaw-gateway.service
  6. loginctl show-user crabbox -p Linger
  7. OPENCLAW_SYSTEMD_UNIT=openclaw-gateway OPENCLAW_STATE_DIR=$(mktemp -d) OPENCLAW_CONFIG_PATH=$(mktemp -d)/config.json ./openclaw.mjs doctor --lint --json --only core/doctor/systemd-linger
  8. Disable and remove the proof unit, then systemctl --user daemon-reload.

Evidence after fix:

provider proof host user=crabbox uid=1000
systemd
Linger=no

systemctl --user is-enabled openclaw-gateway.service
enabled
loginctl show-user crabbox -p Linger
Linger=no

doctor_exit=1
{"ok":false,"checksRun":1,"checksSkipped":32,"findings":[{"checkId":"core/doctor/systemd-linger","severity":"warning","message":"Systemd lingering is disabled for crabbox.","source":"doctor","target":"systemd.user.crabbox","requirement":"systemd user lingering enabled","fixHint":"Run: sudo loginctl enable-linger crabbox"}]}
ASSERT_SYSTEMD_LINGER_FINDING_OK
PROOF_97514_OK

Quiet-path proof:
Earlier WSL source CLI proof with Linger=no and no loaded Gateway systemd user service exited 0 and emitted no findings:

{"ok":true,"checksRun":1,"checksSkipped":32,"findings":[]}

Observed result after fix:
The selected structured lint check stays quiet when the Gateway service is not loaded, and emits the warning only when a real Linux user systemd service for openclaw-gateway is loaded while linger remains disabled. Focused tests on the rebased head cover both the positive selected-lint warning path and the selected quiet path where readSystemdUserLingerStatus is not called unless the Gateway service is loaded.

What was not tested:
After rebasing to head a39e27b668ee57f4ec3279bb9c6c739af7a3b3a9, an exact-head Crabbox rerun was attempted, but the local wrapper timed out and subsequent crabbox list/history broker calls returned HTTP 500 (error code: 1101). The rebased head passed the focused Doctor contribution test file locally in WSL, and the systemd-linger implementation remains the same loaded-service gate proven by the Crabbox run above.

Contract

No config schema, plugin manifest, SDK, persisted data model, or repair-path contract change. This adds only an opt-in structured Doctor lint finding for existing systemd-linger health behavior.

@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

New default-disabled systemd-linger structured lint slice. Validation passed: focused Doctor contribution Vitest 51 tests, changed-file oxlint, tsgo:core, local child check:changed, SDK surface, diff check. No config/plugin/SDK/data-model or repair-path contract change.

@clawsweeper

clawsweeper Bot commented Jun 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@openclaw-barnacle openclaw-barnacle Bot added the maintainer Maintainer-authored PR label Jun 28, 2026
@clawsweeper

clawsweeper Bot commented Jun 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head e3d0f4191ad336660ef5648db0537ca81398de85, but the PR head is now 65ec5a0acfe478f06b5fef38e532f648283d98cd. Its old verdict and PR readiness labels are no longer current.

Next step
Run or wait for a fresh ClawSweeper review on the current PR head.

Review history (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-04T22:57:49.499Z sha a39e27b :: needs real behavior proof before merge. :: [P2] Make the linger lint test portable
  • reviewed 2026-07-04T23:14:36.397Z sha a39e27b :: needs changes before merge. :: [P2] Make the linger lint test portable
  • reviewed 2026-07-04T23:20:34.998Z sha a39e27b :: needs changes before merge. :: [P2] Make the linger lint test portable
  • reviewed 2026-07-04T23:59:58.778Z sha f4096ec :: needs maintainer review before merge. :: none
  • reviewed 2026-07-05T00:08:30.879Z sha f4096ec :: needs maintainer review before merge. :: none
  • reviewed 2026-07-05T00:14:35.732Z sha f4096ec :: needs maintainer review before merge. :: none
  • reviewed 2026-07-05T00:28:24.610Z sha 44e0b1a :: needs maintainer review before merge. :: none
  • reviewed 2026-07-05T00:38:48.032Z sha 91484c7 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jun 28, 2026
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Current head 2fe7e3add2e275e287ee69d877e7939c144c8e9f addresses the systemd-linger scope P2.

Changes:

  • core/doctor/systemd-linger structured lint now mirrors the legacy Doctor precondition by requiring resolveGatewayService().isLoaded(...) before checking systemd/loginctl linger state.
  • Added regression coverage that selected lint stays quiet when the Gateway systemd service is not loaded and does not call readSystemdUserLingerStatus in that case.
  • Kept the check default-disabled; no config/plugin/SDK/data-model or repair-path contract change.

Validation:

  • focused Doctor contribution Vitest: 52 tests
  • changed-file oxfmt --check
  • changed-file oxlint and repo run-oxlint.mjs
  • core tsgo
  • plugin SDK surface/export checks
  • git diff --check
  • source CLI proof: doctor --lint --json --only core/doctor/systemd-linger exits 0 with checksRun: 1 and no findings on WSL where loginctl reports Linger=no but no Gateway systemd user service is loaded

Known proof gap is explicit in the PR body: no real non-WSL loaded Gateway systemd-user-service host was available here, so loaded-service disabled/enabled linger paths remain source-harness covered.

@clawsweeper

clawsweeper Bot commented Jun 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 🔁 re-review loop A fresh ClawSweeper review was explicitly requested after the latest review. and removed 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. labels Jun 28, 2026
@openclaw openclaw deleted a comment from clawsweeper Bot Jun 28, 2026
@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed status: 🔁 re-review loop A fresh ClawSweeper review was explicitly requested after the latest review. labels Jun 28, 2026
@giodl73-repo
giodl73-repo force-pushed the doctor-systemd-linger-lint-findings branch from 2fe7e3a to a39e27b Compare July 4, 2026 22:47
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Maintainer update after refresh:

  • Rebasing onto current main is done; PR head is now a39e27b668ee57f4ec3279bb9c6c739af7a3b3a9.
  • Resolved the test conflict by preserving the newer Doctor inventory/default-disabled coverage and reapplying the systemd-linger selected-lint tests, including the loaded-Gateway-service gate.
  • Focused proof on the rebased head passed: node scripts/run-vitest.mjs run src/flows/doctor-health-contributions.test.ts --reporter=verbose (72 tests) and git diff --check.
  • Real loaded-systemd proof was captured on Crabbox provider azure, lease cbx_6322dfa0e580, run run_2dd29a8828cc: user systemd manager was active, openclaw-gateway.service was enabled, Linger=no, and selected lint emitted core/doctor/systemd-linger with the expected warning/fix hint.
  • I attempted an exact-head Crabbox rerun after the rebase, but the local wrapper timed out and the broker then returned HTTP 500 for list/history. I updated the PR body with the successful real proof plus this limitation instead of claiming exact-head remote proof.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 4, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. and removed P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jul 5, 2026
@openclaw-barnacle openclaw-barnacle Bot added channel: line Channel integration: line channel: mattermost Channel integration: mattermost channel: signal Channel integration: signal channel: qa-channel Channel integration: qa-channel labels Jul 5, 2026
@clawsweeper clawsweeper Bot removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 5, 2026
@giodl73-repo
giodl73-repo merged commit 7bb686c into openclaw:main Jul 5, 2026
105 of 111 checks passed
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

Merged as maintainer after final verification.

What changed in final prep:

  • Marked the PR ready for review.
  • Rebased/synced onto current main; resolved generated plugin SDK budget drift by keeping main's generated values, leaving the PR diff scoped to the two Doctor files.
  • The wrapper review/prepare artifacts record no blocking findings and the accepted opt-in lint compatibility tradeoff.

Validation:

  • Local targeted proof: node scripts/run-vitest.mjs run src/flows/doctor-health-contributions.test.ts --reporter=verbose
  • Local hygiene: git diff --check; ./node_modules/.bin/oxfmt --check src/flows/doctor-health-contributions.test.ts
  • Exact-head hosted checks passed on source head 65ec5a0, including QA Smoke CI, Real behavior proof, security/CodeQL, check-shrinkwrap, and selected CI shards.
  • Crabbox Azure proof exercised a loaded user systemd gateway unit with Linger=no and observed the expected selected Doctor lint warning.

The normal wrapper merge path uses GitHub rebase merge and GitHub rejected that method (This branch can't be rebased), so I used the current maintainer workflow's steerable, head-pinned squash merge path instead.

Source SHA: 65ec5a0
Merged SHA: 7bb686c

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 5, 2026
Expose an opt-in Doctor lint finding for Linux Gateway hosts where a loaded user-level systemd gateway unit has systemd lingering disabled.\n\nValidation:\n- Targeted Doctor health contribution tests passed locally.\n- Exact-head hosted checks passed on 65ec5a0, including QA Smoke CI, Real behavior proof, security/CodeQL, check-shrinkwrap, and selected CI shards.\n- Crabbox Azure proof exercised a loaded user systemd gateway unit with Linger=no and observed the expected lint warning.\n\nCo-authored-by: giodl73-repo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui channel: discord Channel integration: discord channel: feishu Channel integration: feishu channel: imessage Channel integration: imessage channel: line Channel integration: line channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: msteams Channel integration: msteams channel: nostr Channel integration: nostr channel: qa-channel Channel integration: qa-channel channel: qqbot channel: signal Channel integration: signal channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: voice-call Channel integration: voice-call channel: whatsapp-web Channel integration: whatsapp-web channel: zalo Channel integration: zalo channel: zalouser Channel integration: zalouser cli CLI command changes commands Command implementations docs Improvements or additions to documentation extensions: codex extensions: lobster Extension: lobster extensions: memory-core Extension: memory-core extensions: qa-lab extensions: webhooks gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. plugin: google-meet scripts Repository scripts size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant