Repository navigation
Keep a busy daemon through an update, and bring back what a restart stops - #31
Merged
Merged
Conversation
On a host with Xpra the app asks for it as it connects, which waits for a window's loop the test doesn't have, so the sessions never showed. CI has no Xpra, so it only failed on machines that do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tops Restarting after an update replaced the daemon, whose terminals its sessions' programs run on: agents mid-turn stopped, an agent in a shell tab came back as a bare shell that ran what was sent to it, and commands ended unsaid. The daemon is now replaced only when that stops nothing, or when the user says so; a card says what would stop. A restart that does happen tells an agent mid-turn to carry on, once, brings an agent in a terminal back on its conversation in its mode, never with its prompt, and says what commands ended. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 of 4 tasks
Owner
Author
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.
First part of "sessions survive an update". Sessions' programs run on terminals the daemon holds, so replacing the daemon ended them, without asking.
Design
Keep the daemon rather than hand over its terminals. Every update replaced the app and its daemon together, but the app and daemon already work across versions, so the daemon can simply stay.
daemon.restartPlan): agents at work or asking, and what runs in terminals. If nothing, it's replaced as before. Otherwise it stays (hostconn.keepBusyDaemon), for every caller ofConnect, so nothing replaces it by accident.Handing live terminals to a new daemon isn't in this PR: it needs a holder process, and Windows' ConPTY needs its own answer. Listed in the owner's note
acf8233d3e5c.What each system gets
The same on macOS, Linux and Windows, local and remote: nothing is killed by an update unasked, and programs survive for as long as the daemon stays. None yet survive a daemon that is really replaced.
Tests
ENOWX_HOME:TestUpdateKeepsABusyDaemonbuildsenowxd: idle gets replaced, one running a command stays with its PID, asking replaces it and lists what ended.core/agent,proto,client,hostconntest, fulldaemon, and inuithe card's wording andTestReconnectsByItself(fixed here: it hung on hosts with Xpra; the cause isn't in the app).Not run: the real app and the card; a real update; a real agent; remote hosts (
remoteDaemonBusyhas no test, as it needs SSH); Windows and macOS beyond CI and cross-builds.Behavior changes
Queued tasks across a restart depend on #30.
Touches no
go.mod,version/orcloud/, so merging doesn't deploy the cloud.🤖 Generated with Claude Code