Repository navigation
Sonny: [sonny] start_at_boot starts the daemon with the machine - #441
Merged
Merged
Conversation
`sonny setup backup URL` clones a private repository to ~/agent-home and installs a LaunchAgent or systemd user timer that runs `sonny home sync` every ten minutes: ~/.agents and ~/.agent/config.toml are mirrored in, committed and pushed. Keys, logins and the store stay out, as does a config.toml holding a literal secret and memory's own .git (a commit there would make the nightly cleanup find nothing). On a machine that never synced, setup first restores what the repository holds, so a new box is install.sh, then `sonny setup backup URL`. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHNP4M3xCodvaVM2fF
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHNP4M3xCodvaVM2fF
…catch more secrets A sync that failed (one tried before setup) no longer stops setup from restoring; config restores without agents/; a link that became a file is copied as one; restored and backed-up files drop group and other bits; private keys and credentials count as secrets. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHNP4M3xCodvaVM2fF
…rce's owner bits Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHNP4M3xCodvaVM2fF
…-dgjq64 # Conflicts: # sonny/FEATURES.md
…ists are checked for secrets Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHNP4M3xCodvaVM2fF
…itory where this machine keeps its own Sonny names no host. The step tells the lead to find where this machine keeps repositories (its checkouts' remotes, the tools signed in, what the person's other agents made) and make a private one there, then run `sonny setup backup URL`. It is done once a repository and the job are set. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHNP4M3xCodvaVM2fF
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHNP4M3xCodvaVM2fF
On a box reached over SSH, xdg-open (or open on a Mac) starts the browser on the box's own screen, or nowhere, and Sonny said nothing. With SSH_CONNECTION or SSH_TTY set and no DISPLAY, WAYLAND_DISPLAY or BROWSER, the link, file or page now goes on the clipboard (OSC 52 reaches the person's terminal) and the notice says so, as gh and other CLIs print a URL they cannot open. A forwarded display or a BROWSER of the person's still opens. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHNP4M3xCodvaVM2fF
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHNP4M3xCodvaVM2fF
Off by default. On (in /config), Sonny keeps a job that runs `sonny boot`, which starts the daemon as a trigger's fire does, with the login shell's environment: a LaunchAgent run at load on a Mac (at login), or a systemd user oneshot wanted by default.target elsewhere, which starts at boot once the user lingers. Sonny runs `loginctl enable-linger` and says when that needs sudo. The oneshot's daemon runs in a scope of its own, so it outlives the service, and the daemon brings back its companions. Turning it off removes the job and leaves a running daemon running. Sonny's start rewrites the job when Sonny has moved, and sets it up or takes it away when config.toml was edited by hand. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHNP4M3xCodvaVM2fF
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGHNP4M3xCodvaVM2fF
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Merged
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.
🤖 Generated with Claude Code
What
When a dev box reboots, nothing starts the daemon until someone opens Sonny or a trigger fires. Until then, leads waiting on lookout subscriptions and the companions are down.
[sonny] start_at_bootis a switch in/config, off by default. When it's on, Sonny keeps a job that runssonny boot(unlisted). That command starts the daemon of the default store the way a trigger's fire does, with the login shell's environment:me.lydakis.agent.bootwithRunAtLoad, so it runs at login. It has noProcessType Background, because the daemon inherits it.me.lydakis.agent.boot.service,WantedBy=default.targetand enabled.loginctl enable-linger, and when that's refused it says to run it withsudo.systemd-run --scopeof its own, as with trigger fires, so it outlives the service.This follows the usual pattern: rootless Docker's user unit plus linger, and
brew services. The daemon brings back the companions it keeps, the lookout among them. Turning the switch off removes the job (unload/disable) and leaves a running daemon alone.Sonny's start reconciles the job with the setting: it sets the job up or takes it away when config.toml was edited by hand, and rewrites it when Sonny's path moved.
Changes
sonny/src/boot.rs(new):run,apply,at_start, the definitions, and a test.sonny/src/config.rs: the/configrow. Writing the key applies it at once and says what came of it.client/src/config.rs:sonny.start_at_boot(bool, default false).sonny/src/main.rs: thebootdispatch andboot::at_start().sonny/src/trigger.rs:UserManager,find,runandNOT_LOADEDare nowpub(crate).sonny/README.mdandsonny/FEATURES.md.There is no daemon, protocol or schema change.
Checks
cargo test -p sonnypasses: 538, plus 8 in the second binary.cargo test -p agent-clientpasses.cargo clippy --workspace --all-targetsandcargo fmtare clean.default.target.wants.systemctl --user startran the oneshot. It exited, and the daemon kept running in its ownrun-*.scope.AGENT_BINwas set in a drop-in, since a dev build has nolibexec/agent.