feat(daemon): /agentd restart [binary path] (#145)#156
Merged
Conversation
`/agentd restart` can now take an optional binary path and exec that instead of the daemon's own binary — e.g. hot-swap into a freshly-built worktree binary without killing the fleet. `/agentd restart` with no argument keeps the existing in-place re-exec. - `daemon.restart` IPC gains an optional `exe` param (DaemonRestartParams); older clients send `null` and still get the in-place restart. - The path is validated daemon-side BEFORE tearing down — canonicalized, must exist, be a regular file, and be executable — so a typo returns an error and the daemon stays up rather than exec()ing a missing binary and never coming back. Original args are preserved, so the new binary serves the same socket. - TUI slash parses `restart [path]`; `client.daemon_restart(exe)`. Tests: `validate_restart_exe` (accepts an executable, rejects missing / directory / non-executable); e2e restart callers updated. Verified end-to-end: bad path → error + daemon alive; valid path → daemon re-execs into it and comes back on the same socket.
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.
Closes #145.
/agentd restartnow accepts an optional binary path and execs that binary instead of the daemon's own — e.g. hot-swap into a freshly-built worktree binary without killing the fleet. With no argument it behaves exactly as before (in-place re-exec to pick up an upgraded binary at the same path).How
daemon.restartIPC gains an optionalexeparam (DaemonRestartParams). Older clients sendnulland still get the in-place restart (back-compatible).run --socket …) are preserved, so the new binary serves the same socket./agentd restart [path]splits off the optional path;client.daemon_restart(exe)carries it.Tests
validate_restart_exe_accepts_executable_rejects_bad_paths— accepts an executable file (returns the canonical absolute path), rejects missing path / directory / non-executable file.daemon.restart {exe:"/no/such/binary"}→ error + daemon still alive;daemon.restart {exe:<copy>}→ daemon re-execs into the copy and comes back serving the same socket.(The one failing workspace test is the pre-existing debug-only timing flake
many_pinned_sessions_resize_within_budget.)🤖 Generated with Claude Code