Repository navigation
fix(daemon): recovery hints target the wrong profile or container - #130216
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 1:23 PM ET / 17:23 UTC. ClawSweeper reviewWhat this changesThe PR passes each daemon diagnostic’s service environment to the shared Linux systemd recovery-hint formatter so displayed gateway commands retain the selected profile or container. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep open for ordinary maintainer review. Current main and the latest release still render the foreground recovery command without the caller-provided environment; this focused change moves that context into the shared hint owner and has no actionable patch defect. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherDoctor and gateway status inspect a gateway service and render recovery guidance when systemd user services are unavailable. The shared hint formatter turns that service context into the command an operator is asked to run next. flowchart LR
A[Doctor or gateway status] --> B[Service environment]
B --> C[Systemd unavailable diagnosis]
C --> D[Shared recovery hint formatter]
D --> E[Target-aware gateway command]
E --> F[Operator recovery]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -4, Tests +14. Total +10 across 8 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Land the single canonical environment-aware formatter path with the focused profile/container regression coverage. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main’s shared hint formats the foreground command without the diagnosed service environment, while the command formatter already defines profile/container preservation when that environment is supplied. Is this the best way to solve the issue? Yes. Resolving the target in the shared hint formatter reuses the existing command-formatting contract and removes duplicated caller-side container interpretation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 447895981826. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Reviewed the latest ClawSweeper result: no code or security findings remain. The stored-data warning is a false positive from the doctor test path: this PR changes diagnostic text formatting and its tests only; it introduces no schema, persistence, migration, authentication, or service-execution change. The existing formatter remains the owner of profile/container precedence. All 256 focused owner/sibling tests and the full dependency/export check passed. The remaining hosted lint jobs ended with an explicit runner shutdown signal, not a lint diagnostic. Those interrupted jobs are being rerun on the unchanged reviewed commit now that GitHub Actions has recovered; landing still waits for the required CI gate. |
|
Merged via squash.
|
…enclaw#130216) * fix(daemon): preserve profile context in systemd recovery hints * fix(cli): remove obsolete daemon container helper export
Closes #130214
What Problem This Solves
Fixes an issue where Linux users diagnosing a gateway without an available systemd user service would receive a recovery command for the default gateway instead of their selected profile or container. Copying the suggested command could therefore start the wrong gateway.
Why This Change Was Made
The shared systemd-hint owner now receives the same service environment that already drives doctor and gateway-status diagnostics. It resolves container context and formats the command from that one canonical environment; existing callers without an explicit environment continue to use their current process environment.
This removes duplicated container detection from both callers and deletes the resulting obsolete CLI helper re-export instead of preserving a test-only production seam. Existing WSL and headless-server behavior and container-over-profile precedence remain unchanged. Production delta: +6/-10, net -4 lines.
User Impact
Recovery hints now remain copy-pasteable for
openclaw --profile blue gatewayandopenclaw --container sandbox gateway, including when both settings are present. No service, authentication, configuration, or persistence behavior changes.Evidence
pnpm deadcode:fullgate locally after removing the obsolete re-export.