Repository navigation
feat(cli): commonly daemon install — the login service (ADR-026 D1) - #1570
Merged
Merged
Conversation
`commonly daemon install` registers the resident daemon as a login service: a launchd LaunchAgent on macOS (KeepAlive — launchd restarts a dead daemon), a systemd user unit on Linux (Restart=always). Both run the exact interpreter + CLI entry that executed the install, resolved at install time — a PATH lookup at boot would race version managers and silently run a different install than the one the user tested. The unit's PATH carries homebrew for the CHILDREN: seats spawn the user's claude/codex by name, and launchd's default PATH would kill every seat at adapter detection while the daemon itself looked healthy. Install requires a registered daemon credential (a service without one just crash-loops at boot). `daemon uninstall` unloads and removes; a failing launchctl load surfaces instead of reporting success. 8 new tests on the generated units and both flows, side effects injected. cli 0.1.34 → 0.1.35 (0.1.33 is claimed by open #1561, 0.1.34 by #1568). Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01EtwYLMJAYuZ3grLQoXWMWT
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01EtwYLMJAYuZ3grLQoXWMWT
…ly into feat/daemon-install
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ADR-026 D1's "installed once": after
commonly daemon register+commonly daemon install, the machine needs no terminal ever again — the daemon starts at login, launchd/systemd restarts it if it dies, and every reboot brings the whole supervised seat set back (the failure class that silently killed 22 fleet seats twice on 2026-09-03).What changed
~/Library/LaunchAgents/me.commonly.daemon.plist(KeepAlive + RunAtLoad, logs to~/.commonly/logs/daemon/daemon.log),launchctl load -w. Same shape as the proven fleet-supervisor agent.~/.config/systemd/user/commonly-daemon.service(Restart=always),systemctl --user enable --now.claude/codexby name, and under launchd's default PATH the daemon comes up healthy while every seat dies at adapter detection.installrefuses without a registered daemon credential (the service would just crash-loop); a failinglaunchctl loadsurfaces as an error, never as success.daemon uninstallunloads and removes; nothing installed is a no-op.Verification
8 new tests (unit content: label/argv/KeepAlive/PATH/log paths; darwin + linux install flows; load-failure surfacing; uninstall + no-op) with every side effect injected. Full CLI suite 431 green, lint clean. cli → 0.1.35 (0.1.33 claimed by open #1561, 0.1.34 by #1568).
Not in scope: actually migrating the operator fleet (D7) — that's a deliberate, careful step because the mint-rotate path can kill live seats.
🤖 Generated with Claude Code
https://claude.ai/code/session_01EtwYLMJAYuZ3grLQoXWMWT