Retry the agent host IPC connect on a slow-boot channel-registration timeout - #328862
Open
vijayupadya wants to merge 2 commits into
Open
Retry the agent host IPC connect on a slow-boot channel-registration timeout#328862vijayupadya wants to merge 2 commits into
vijayupadya wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds bounded retry handling for transient agent-host IPC channel registration timeouts.
Changes:
- Adds cancellable exponential-backoff connection retries.
- Adds tests for success, failure, exhaustion, disposal, and listener counts.
Show a summary per file
| File | Description |
|---|---|
agentHostIpcChannelTransport.ts |
Implements retry and cancellation logic. |
agentHostIpcChannelTransport.test.ts |
Tests retry behavior and teardown. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
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.
Summary
The local agent host is reached from each window over a MessagePort IPC channel named
agentHostProtocol. On a slow host boot the process registers that channel only after the IPCChannelServer's 1s unknown-channel timeout, so the renderer'sconnect()call is rejected with a transient"Channel name 'agentHostProtocol' timed out after 1000ms". The local transport has no reconnect, so it treats this as fatal and closes permanently — the connection'srootStatenever hydrates, no agents are advertised, and the agent host option goes missing from the session-target picker.This change retries that one transient condition instead of giving up.
Fix
AgentHostIpcChannelTransport.connect()now retries the upstreamconnectwhile the agent host is still registering its channel:'Unknown channel'timeout; any other error is surfaced unchanged.dispose()(via aCancellationTokenSource), matching the file's convention that every delay timer is cancelled on teardown.ChannelServerbuffers event-listens to a not-yet-registered channel and flushes them on registration, so no double-subscription across retries.Tests
agentHostIpcChannelTransport.test.ts:'Unknown channel'timeout until the host registers its channel (and subscribes listeners exactly once),