fix(installer): restart upgraded systemd services#833
Conversation
Restart active wn-agent and wn-opencode user services after replacing their binaries and units. Keep enable --now for fresh installs and preserve no-start paths. Fixes #832
|
Warning Review limit reached
Next review available in: 48 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Ready to review this PR? Stage has broken it down into 3 individual chapters for you:
Chapters generated by Stage for commit 9b59c8c on Jul 12, 2026 6:07pm UTC. |
agent-p1p
left a comment
There was a problem hiding this comment.
Adversarial review of 8e1d4ef
BLOCKING:
- none
SUGGESTION:
- Dry-run output no longer describes the upgrade path:
scripts/install-opencode-marmot.sh:494,535still says the installer would runenable --nowunconditionally. A real active-service upgrade now runsenableplusrestart. Since dry-run intentionally avoids the state probe, wording such as “enable/start, or restart if already active” would keep the preview accurate. - Guard the explicit no-start behavior in the new active-service fixture:
integrations/opencode/marmot/tests/test_installer.sh:135-142exercises the active default path, while--no-start-wn-opencodeis covered only by dry-run text. An active fixture with--no-start-wn-opencodethat asserts norestart wn-opencode.servicecall would lock in the PR’s preservation claim.
NITPICK:
- none
FOLLOW-UP:
- Filed #834 for the same pre-existing upgrade bug in the Hermes and OpenClaw installers. This is out of scope for #832/#833: #834
SUMMARY: The change is small and correct. After unit rewrite and daemon-reload, active wn-agent and wn-opencode user services take the enable + restart path and therefore load the new executable/environment; inactive services retain enable --now. Existing --no-service, --no-start-wn-agent, and --no-start-wn-opencode gates remain upstream. The deterministic mock uses exact command-line assertions to distinguish fresh and active upgrades. No security/privacy regressions or sensitive paths were found.
VERDICT: APPROVE
SENSITIVE_PATHS: none
Verified locally:
integrations/opencode/marmot/tests/test_installer.sh— passedbash -n scripts/install-opencode-marmot.sh integrations/opencode/marmot/tests/test_installer.sh— passedgit diff --check origin/master...HEAD— passed
Keep Linux dry-run output accurate for active-service upgrades and verify --no-start-wn-opencode skips every systemd action for the harness.
|
Addressed both adversarial-review suggestions in 9b59c8c: Linux dry-run output now describes enable/start versus active-service restart, and the active-service fixture verifies --no-start-wn-opencode performs no systemd probe, enable, or restart for wn-opencode. Local installer and shell-syntax checks pass. |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
wn-agentandwn-opencodesystemd user services after unit reloadsenable --nowfor inactive services and preserve existing no-start optionsTest plan
just opencode-installer-testbash -n scripts/install-opencode-marmot.sh integrations/opencode/marmot/tests/test_installer.shjust fast-cigates: fmt, naming, default/OTLP checks, and default/OTLP clippy (clippy completed with a tmpfs target after the root filesystem filled)Fixes #832