Repository navigation
agentHost: add local host restart command - #329839
Merged
Merged
Conversation
Add a Developer command that replaces the shared local Agent Host process and reconnects every local client immediately. Preserve fresh-host subscriptions and restore cold sessions before applying queued actions so existing chats and tool confirmations continue after restart.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a desktop command to restart the shared local Agent Host while preserving client state and reconnecting windows.
Changes:
- Adds restart command registration for editor and Agents windows.
- Coordinates main-process restart and renderer reconnection.
- Restores subscriptions and cold sessions before replaying actions.
Show a summary per file
| File | Description |
|---|---|
restartAgentHostAction.ts |
Defines the developer command. |
chatDeveloperActions.ts |
Registers the editor command. |
agentHost.contribution.ts |
Registers the Agents-window command. |
AGENT_HOST_SESSIONS_PROVIDER.md |
Documents desktop commands. |
protocolServerHandler.test.ts |
Tests pending subscriptions. |
agentService.test.ts |
Tests cold-session restoration. |
agentHostService.test.ts |
Tests restart lifecycle behavior. |
protocolServerHandler.ts |
Retains subscriptions without snapshots. |
agentService.ts |
Restores sessions before dispatch. |
agentHostService.ts |
Serializes process lifecycle operations. |
electronAgentHostStarter.ts |
Handles restart IPC and window notification. |
localAgentHostService.ts |
Reconnects local renderer clients. |
common/agentService.ts |
Defines restart IPC channels. |
common/agent.ts |
Exposes restart requests from starters. |
Review details
Tip
Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 14/14 changed files
- Comments generated: 4
- Review effort level: Balanced
roblourens
marked this pull request as ready for review
August 9, 2026 18:57
roblourens
enabled auto-merge (squash)
August 9, 2026 18:57
roblourens
marked this pull request as draft
August 9, 2026 18:58
auto-merge was automatically disabled
August 9, 2026 18:58
Pull request was converted to draft
Recover interrupted initial handshakes, restore cold subagents through their parent sessions, and bound restart lifecycle disposables. Add regression coverage for each review finding.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <[email protected]>
Dmitriy Vasyura (dmitrivMS)
previously approved these changes
Aug 9, 2026
roblourens
marked this pull request as ready for review
August 9, 2026 19:15
roblourens
enabled auto-merge (squash)
August 9, 2026 19:15
Justin Chen (justschen)
approved these changes
Aug 9, 2026
This was referenced Aug 13, 2026
Misha Damjanic (mdamjanic7)
added a commit
to mdamjanic7/pihub
that referenced
this pull request
Aug 24, 2026
…n (temporary core patch) Upstream microsoft#329839 (bba5e40, 2026-08-17 sync) made _getManagementService async resolving to the ProxyChannel.toService proxy; _callManagement awaits it, so JS treats the proxy as a thenable — .then is proxied as an RPC whose function arguments serialize to zero-length objects. The agent host fails to deserialize the frame (SyntaxError: Unexpected end of JSON input on stderr), never responds, and the awaited call hangs forever (Compact Conversation spinner, 100% repro). Split the readiness wait (void) from the proxy accessor (sync) so the proxy never travels through promise resolution. Superseded by upstream microsoft#330030 / microsoft#330567 (bd094b5) in the deferred slice — drop on that merge and re-home compactSession onto the synchronous accessor. Ledger: docs/pihub-patches.md.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Validation
web_fetchconfirmation appeared, approval reached the provider, and the turn completednpm run typecheck-clientnpm run valid-layers-check(Written by Copilot)