fix(status): detect system-level systemd units via INVOCATION_ID#85151
fix(status): detect system-level systemd units via INVOCATION_ID#85151yiyouguisu wants to merge 1 commit into
Conversation
|
Codex review: needs real behavior proof before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. at source level: the linked issue gives a concrete system-level systemd workflow, and current main returns PR rating Rank-up moves:
What the crustacean ranks mean
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. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review findings
Review detailsBest possible solution: Make the status path probe the actual discovered system-scope OpenClaw unit, preserve the current unavailable result when no system unit exists, and back it with focused tests plus a real systemd transcript. Do we have a high-confidence way to reproduce the issue? Yes, at source level: the linked issue gives a concrete system-level systemd workflow, and current main returns Is this the best way to solve the issue? No. The durable fix should use the actual exec result contract, check systemd Label changes:
Label justifications:
Full review comments:
Overall correctness: patch is incorrect Acceptance criteria:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against c8a35c4645dc. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
When the gateway runs under a system-level systemd unit (not user-level), systemctl --user is unavailable and the status check reports "systemd user services unavailable" as a false positive. Instead of relying on INVOCATION_ID detection, directly probe system-level systemctl when user-level fails. If the unit exists and responds at system level, return the actual status. Fixes openclaw#85094
1ee5ebb to
0db2a0a
Compare
|
Reviewing this against Blocking — the fallback is dead code. Fix: High — PR title/body advertise INVOCATION_ID gating that the diff doesn't implement. Either gate the fallback via High — no tests. Smaller follow-ups in the same patch:
Scope note. This patches |
Summary
When the gateway runs under a system-level systemd unit (not user-level),
systemctl --useris unavailable andopenclaw status --deepreports "systemd user services unavailable" as a false positive, even though the gateway is healthy.Fix
Detect the
INVOCATION_IDenvironment variable that systemd sets for managed processes. When present, fall back to system-levelsystemctlto check the actual service status instead of returning "unknown".How it works
readSystemdServiceRuntimecatches theassertSystemdAvailableerrorINVOCATION_IDenv var (set by systemd for managed processes)systemctl show(system-level) instead ofsystemctl --userBefore
After
When running under a system-level unit, the actual service status is shown correctly.
Testing
Fixes #85094