agentHost: improve update pickup and fix startup-failure wedge#313541
Merged
Conversation
- Shorten background update check interval from 24h to 6h so newly published server versions are picked up sooner after auto-shutdown. - Don't store the child into self.running when it exits before signaling ready. Previously a failed startup left a dead child in running forever, wedging ensure_server() so it could never restart the server. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dmitrivMS
approved these changes
Apr 30, 2026
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.
Two fixes to the agent host update logic in
cli/src/tunnels/agent_host.rs:Shorten background update check interval from 24h to 6h. Newly published server versions are picked up sooner after the server auto-shuts down (via
--enable-remote-auto-shutdown).Fix startup-failure wedge. When the child server process exited before signaling readiness,
run_serverwould still store the (now-dead)Childintoself.runningand skip spawning the cleanup task. From then onrunning.is_some()was permanently true, soensure_serverwould forever return the original opener'sErrand never attempt a restart. The child is now left out ofrunningon the early-exit path;self.readystill has theErrfor the original caller, but subsequentensure_servercalls fall through to a freshstart_server.No synchronous update check is added on the connection path, to keep boot time fast.