Skip to content

fix(systemd): parse all inline environment assignments - #117484

Merged
steipete merged 1 commit into
mainfrom
codex/autoqa-systemd-env-20260801
Aug 1, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/autoqa-systemd-env-20260801

Conversation

@steipete

@steipete steipete commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Closes #117483

What Problem This Solves

Fixes an issue where Linux operators with multiple assignments on one valid systemd Environment= directive could see OpenClaw parse a malformed service identity and report the wrong Gateway status.

Why This Change Was Made

The installed-service reader now reuses the existing plural systemd assignment parser and applies every assignment in declaration order. Later inline duplicates keep normal last-write-wins behavior, EnvironmentFile= values retain precedence, and the now-private singular parser remains only an implementation detail of the canonical plural owner.

User Impact

Gateway status and doctor paths read all inline systemd variables correctly, including profile and unit-name values, without changing generated units, environment-file semantics, service lifecycle, configuration, or public APIs.

Evidence

Release-note context: OpenClaw now reads every assignment from valid multi-value systemd Environment= directives when inspecting installed Gateway services.

AI-assisted: yes. The implementation was independently reviewed and remotely validated.

@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Aug 1, 2026
@steipete
steipete marked this pull request as ready for review August 1, 2026 15:51
@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Aug 1, 2026
@clawsweeper clawsweeper Bot added 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. P2 Normal backlog priority with limited blast radius. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 1, 2026, 11:56 AM ET / 15:56 UTC.

ClawSweeper review

What this changes

This branch makes the Linux installed-service reader parse every assignment in a systemd Environment= directive and adds regression coverage for ordering, duplicate keys, file overrides, and provenance.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 3 items remain

Keep this PR open for normal maintainer review. The patch repairs a source-proven Linux service-inspection bug by using the existing canonical plural parser, and I found no correctness or security defect in the branch; however, its cited validation is fixture-based and does not yet show the repaired path against a real systemd user unit.

Priority: P2
Reviewed head: f6d5e2c19b4d1dff108fd8c568cdfc2f40fb32e3

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The source repair is focused and well-covered by regression tests, but real operator-visible proof remains a merge gate.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR body cites a focused Testbox run, but the new reader regression uses a mocked filesystem; please add redacted after-fix proof from a real Linux systemd user-unit reader or status path before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body cites a focused Testbox run, but the new reader regression uses a mocked filesystem; please add redacted after-fix proof from a real Linux systemd user-unit reader or status path before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 6 items Current-main defect: Current main reads each Environment= line with the singular parser, so a valid line containing multiple assignments yields only one parsed entry before environment-file merging.
Existing canonical parser: Current main already owns a plural parser that quote-splits a directive and parses every entry; the branch reuses that implementation rather than adding a parallel grammar.
Branch behavior and regression scope: The proposed loop applies parsed assignments in declaration order, while the added reader test covers quoted and unquoted values, duplicate inline keys, EnvironmentFile override precedence, and value-source provenance.
Findings None None.
Security None None.

How this fits together

Gateway status and doctor inspect the installed service definition to determine the command, environment, and service identity. On Linux, the systemd reader converts unit-file directives into a command configuration that downstream service audit and status paths consume.

flowchart LR
  A[Gateway status or doctor] --> B[Service registry]
  B --> C[Linux systemd reader]
  C --> D[Environment directive parser]
  D --> E[Command configuration]
  E --> F[Service audit and status output]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body cites a focused Testbox run, but the new reader regression uses a mocked filesystem; please add redacted after-fix proof from a real Linux systemd user-unit reader or status path before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The branch has no after-fix proof from a real Linux systemd user-unit setup; mocked filesystem coverage cannot establish the operator-visible status or doctor outcome.
  • Complete next step (P2) - The code repair is concrete, but the external-PR real-behavior gate requires contributor-provided Linux systemd proof and the protected maintainer label keeps merge handling human-visible.
Agent review details

Security

None.

PR surface

Source -2, Tests +33. Total +31 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 2 4 -2
Tests 1 33 0 +33
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 35 4 +31

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #117483
Summary: This PR is the candidate repair for the linked report; current-main source confirms the report's singular-versus-plural parser mismatch.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the shared plural parser as the single owner, then add a redacted terminal transcript from a disposable Linux systemd user unit showing the service reader or Gateway status path recognizes both inline variables before merge.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the shared plural parser as the single owner, then add a redacted terminal transcript from a disposable Linux systemd user unit showing the service reader or Gateway status path recognizes both inline variables before merge.

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

Yes, from source: current main passes a complete multi-assignment directive to the singular parser at src/daemon/systemd.ts:331, while the existing plural parser already splits those entries correctly. I did not execute a live systemd user-service reproduction in this read-only review.

Is this the best way to solve the issue?

Yes for the code path: routing the reader through the existing plural parser is narrower and more maintainable than changing the unit generator or introducing another parser. The remaining proof should exercise a real unit file rather than broaden the implementation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 83208eb4a96a.

Labels

Label changes:

  • add P2: This is a bounded Linux service-inspection defect that can make Gateway status or doctor report the wrong installed-service identity without affecting message delivery or runtime availability.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body cites a focused Testbox run, but the new reader regression uses a mocked filesystem; please add redacted after-fix proof from a real Linux systemd user-unit reader or status path before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: This is a bounded Linux service-inspection defect that can make Gateway status or doctor report the wrong installed-service identity without affecting message delivery or runtime availability.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body cites a focused Testbox run, but the new reader regression uses a mocked filesystem; please add redacted after-fix proof from a real Linux systemd user-unit reader or status path before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Current-main defect: Current main reads each Environment= line with the singular parser, so a valid line containing multiple assignments yields only one parsed entry before environment-file merging. (src/daemon/systemd.ts:331, 83208eb4a96a)
  • Existing canonical parser: Current main already owns a plural parser that quote-splits a directive and parses every entry; the branch reuses that implementation rather than adding a parallel grammar. (src/daemon/systemd-unit.ts:148, 83208eb4a96a)
  • Branch behavior and regression scope: The proposed loop applies parsed assignments in declaration order, while the added reader test covers quoted and unquoted values, duplicate inline keys, EnvironmentFile override precedence, and value-source provenance. (src/daemon/systemd.test.ts:1268, f6d5e2c19b4d)
  • Feature provenance: Blame attributes the current reader and both parser paths to the same initial area commit, making the branch's reuse of the plural parser a coherent owner-boundary repair. (src/daemon/systemd.ts:331, 7ab05df415a4)
  • Real-proof gap: The cited focused test is valuable regression coverage but its reader fixture replaces filesystem reads, so it does not demonstrate parsing an actual systemd unit after the fix. (src/daemon/systemd.test.ts:177, f6d5e2c19b4d)
  • External-review infrastructure: The local systemd manual page was unavailable, and live GitHub/GitHub remote queries failed due network resolution; this review therefore relies on the supplied PR context plus locally inspected current-main and branch source.

Likely related people:

  • steipete: Current-main blame attributes the systemd service reader and the singular/plural parsing helpers to this contributor, and the proposed branch follows that existing parsing boundary. (role: current area contributor and parser-path author; confidence: high; commits: 7ab05df415a4, f6d5e2c19b4d; files: src/daemon/systemd.ts, src/daemon/systemd-unit.ts, src/daemon/systemd.test.ts)

Rank-up moves

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

  • Attach a redacted terminal transcript from a disposable Linux user service with multiple inline assignments, showing the repaired reader or Gateway status result.
  • Keep private paths, tokens, hostnames, and service details redacted in the proof.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete

steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready proof for current head f6d5e2c19b4d1dff108fd8c568cdfc2f40fb32e3:

The fresh ClawSweeper workflow https://github.com/openclaw/clawsweeper/actions/runs/30706910987 completed successfully but left only its current-head placeholder comment, so it published no additional Rank-up moves to apply.

@steipete
steipete merged commit ae1ab26 into main Aug 1, 2026
259 of 268 checks passed
@steipete
steipete deleted the codex/autoqa-systemd-env-20260801 branch August 1, 2026 16:09
@steipete

steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

pull Bot pushed a commit to mcx/moltbot that referenced this pull request Aug 1, 2026
* origin/main: (44 commits)
  fix(plugins): compare authoring metadata by canonical JSON semantics (openclaw#117486)
  fix(doctor): reject contradictory lint check selectors (openclaw#117495)
  fix(anthropic): honor configured model pricing (openclaw#117275)
  refactor(plugins): reuse scoped loader for capability discovery (openclaw#117373)
  refactor(test): derive changed tooling routes (openclaw#117407)
  fix(kova): clarify extension memory attribution (openclaw#117500)
  fix(imessage): sanitize private context on every outbound path (openclaw#117501)
  fix(ci): align release validation fixtures (openclaw#117494)
  fix(talk): preserve owner authorization in realtime consults (openclaw#114163)
  fix(ui): surface aborted-run diagnostics (openclaw#117497)
  perf(models): skip Ollama row runtime loading (openclaw#117465)
  fix(cli): report user profile command outcomes (openclaw#117466)
  fix(active-memory): detect Chinese recall intent in escalate mode (openclaw#117338) (openclaw#117419)
  fix(workboard): ignore caller-supplied archivedAt when creating a card (openclaw#116412)
  fix(models): avoid waiting on promotions before listing models (openclaw#117322)
  refactor(plugins): inherit shared package boundary settings (openclaw#117474)
  fix(systemd): parse all inline environment assignments (openclaw#117484)
  feat(web-fetch): add tools.web.fetch.headers for operator request headers (openclaw#115545)
  fix(qa): Slack progress lane misses successful delivery (openclaw#117391)
  refactor: deduplicate Codex prompt snapshot fixtures (openclaw#117476)
  ...
abdulrahman305 pushed a commit to qenex-ai/openclaw that referenced this pull request Aug 1, 2026
* origin/main: (41 commits)
  fix(plugins): compare authoring metadata by canonical JSON semantics (openclaw#117486)
  fix(doctor): reject contradictory lint check selectors (openclaw#117495)
  fix(anthropic): honor configured model pricing (openclaw#117275)
  refactor(plugins): reuse scoped loader for capability discovery (openclaw#117373)
  refactor(test): derive changed tooling routes (openclaw#117407)
  fix(kova): clarify extension memory attribution (openclaw#117500)
  fix(imessage): sanitize private context on every outbound path (openclaw#117501)
  fix(ci): align release validation fixtures (openclaw#117494)
  fix(talk): preserve owner authorization in realtime consults (openclaw#114163)
  fix(ui): surface aborted-run diagnostics (openclaw#117497)
  perf(models): skip Ollama row runtime loading (openclaw#117465)
  fix(cli): report user profile command outcomes (openclaw#117466)
  fix(active-memory): detect Chinese recall intent in escalate mode (openclaw#117338) (openclaw#117419)
  fix(workboard): ignore caller-supplied archivedAt when creating a card (openclaw#116412)
  fix(models): avoid waiting on promotions before listing models (openclaw#117322)
  refactor(plugins): inherit shared package boundary settings (openclaw#117474)
  fix(systemd): parse all inline environment assignments (openclaw#117484)
  feat(web-fetch): add tools.web.fetch.headers for operator request headers (openclaw#115545)
  fix(qa): Slack progress lane misses successful delivery (openclaw#117391)
  refactor: deduplicate Codex prompt snapshot fixtures (openclaw#117476)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 2, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 2, 2026
* origin/main: (44 commits)
  fix(plugins): compare authoring metadata by canonical JSON semantics (openclaw#117486)
  fix(doctor): reject contradictory lint check selectors (openclaw#117495)
  fix(anthropic): honor configured model pricing (openclaw#117275)
  refactor(plugins): reuse scoped loader for capability discovery (openclaw#117373)
  refactor(test): derive changed tooling routes (openclaw#117407)
  fix(kova): clarify extension memory attribution (openclaw#117500)
  fix(imessage): sanitize private context on every outbound path (openclaw#117501)
  fix(ci): align release validation fixtures (openclaw#117494)
  fix(talk): preserve owner authorization in realtime consults (openclaw#114163)
  fix(ui): surface aborted-run diagnostics (openclaw#117497)
  perf(models): skip Ollama row runtime loading (openclaw#117465)
  fix(cli): report user profile command outcomes (openclaw#117466)
  fix(active-memory): detect Chinese recall intent in escalate mode (openclaw#117338) (openclaw#117419)
  fix(workboard): ignore caller-supplied archivedAt when creating a card (openclaw#116412)
  fix(models): avoid waiting on promotions before listing models (openclaw#117322)
  refactor(plugins): inherit shared package boundary settings (openclaw#117474)
  fix(systemd): parse all inline environment assignments (openclaw#117484)
  feat(web-fetch): add tools.web.fetch.headers for operator request headers (openclaw#115545)
  fix(qa): Slack progress lane misses successful delivery (openclaw#117391)
  refactor: deduplicate Codex prompt snapshot fixtures (openclaw#117476)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 2, 2026
* origin/main: (27 commits)
  fix(plugins): compare authoring metadata by canonical JSON semantics (openclaw#117486)
  fix(doctor): reject contradictory lint check selectors (openclaw#117495)
  fix(anthropic): honor configured model pricing (openclaw#117275)
  refactor(plugins): reuse scoped loader for capability discovery (openclaw#117373)
  refactor(test): derive changed tooling routes (openclaw#117407)
  fix(kova): clarify extension memory attribution (openclaw#117500)
  fix(imessage): sanitize private context on every outbound path (openclaw#117501)
  fix(ci): align release validation fixtures (openclaw#117494)
  fix(talk): preserve owner authorization in realtime consults (openclaw#114163)
  fix(ui): surface aborted-run diagnostics (openclaw#117497)
  perf(models): skip Ollama row runtime loading (openclaw#117465)
  fix(cli): report user profile command outcomes (openclaw#117466)
  fix(active-memory): detect Chinese recall intent in escalate mode (openclaw#117338) (openclaw#117419)
  fix(workboard): ignore caller-supplied archivedAt when creating a card (openclaw#116412)
  fix(models): avoid waiting on promotions before listing models (openclaw#117322)
  refactor(plugins): inherit shared package boundary settings (openclaw#117474)
  fix(systemd): parse all inline environment assignments (openclaw#117484)
  feat(web-fetch): add tools.web.fetch.headers for operator request headers (openclaw#115545)
  fix(qa): Slack progress lane misses successful delivery (openclaw#117391)
  refactor: deduplicate Codex prompt snapshot fixtures (openclaw#117476)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 2, 2026
* origin/main: (41 commits)
  fix(plugins): compare authoring metadata by canonical JSON semantics (openclaw#117486)
  fix(doctor): reject contradictory lint check selectors (openclaw#117495)
  fix(anthropic): honor configured model pricing (openclaw#117275)
  refactor(plugins): reuse scoped loader for capability discovery (openclaw#117373)
  refactor(test): derive changed tooling routes (openclaw#117407)
  fix(kova): clarify extension memory attribution (openclaw#117500)
  fix(imessage): sanitize private context on every outbound path (openclaw#117501)
  fix(ci): align release validation fixtures (openclaw#117494)
  fix(talk): preserve owner authorization in realtime consults (openclaw#114163)
  fix(ui): surface aborted-run diagnostics (openclaw#117497)
  perf(models): skip Ollama row runtime loading (openclaw#117465)
  fix(cli): report user profile command outcomes (openclaw#117466)
  fix(active-memory): detect Chinese recall intent in escalate mode (openclaw#117338) (openclaw#117419)
  fix(workboard): ignore caller-supplied archivedAt when creating a card (openclaw#116412)
  fix(models): avoid waiting on promotions before listing models (openclaw#117322)
  refactor(plugins): inherit shared package boundary settings (openclaw#117474)
  fix(systemd): parse all inline environment assignments (openclaw#117484)
  feat(web-fetch): add tools.web.fetch.headers for operator request headers (openclaw#115545)
  fix(qa): Slack progress lane misses successful delivery (openclaw#117391)
  refactor: deduplicate Codex prompt snapshot fixtures (openclaw#117476)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Systemd service reader merges multiple Environment assignments

1 participant