- Handle message events in AgentEventMapper to emit markdown response
parts for text that arrives without preceding delta events (e.g. after
tool calls complete)
- Fix tool call confirmation flickering by guarding PendingConfirmation
re-entry when the invocation is already waiting for confirmation
- Fix tool call duplication in server-initiated turns and reconnection
by not removing finalized tool calls from the tracking map
- Add isComplete guard in finish() to avoid overwriting finalized tool
call state
- Extract processState in _trackServerTurnProgress for immediate state
reconciliation closing gaps between turn detection and listener
registration
- Fix session disappearing from list after first message by adding
pending session tracking and onDidReplaceSession in the remote
sessions provider
- Wrap all tests using timeouts with runWithFakedTimers
* Unify agentHost server-side dispatch: remove IProtocolSideEffectHandler
Eliminate the IProtocolSideEffectHandler interface and make
ProtocolServerHandler talk to IAgentService directly. This removes
the duplicate adapter layer between the WebSocket protocol server
and the real service implementation.
Changes:
- ProtocolServerHandler now takes IAgentService + SessionStateManager +
IProtocolServerConfig instead of IProtocolSideEffectHandler
- Deleted ~40-line inline adapter in agentHostMain.ts
- agentHostServerMain.ts now uses AgentService instead of manually
wiring SessionStateManager + AgentSideEffects
- Removed implements IProtocolSideEffectHandler from AgentSideEffects
- Removed dead methods from AgentSideEffects that were only needed
by the deleted interface (handleCreateSession, handleDisposeSession,
handleListSessions, handleGetResourceMetadata, handleAuthenticate,
getDefaultDirectory)
- Type conversions (URI<->string, IAgentSessionMetadata<->ISessionSummary)
now happen at the protocol boundary in ProtocolServerHandler
- Fixed dispatchAction double-dispatch: WS path previously dispatched
to stateManager AND called handleAction (which dispatched again)
- Extension methods (getResourceMetadata, authenticate, etc.) now call
IAgentService directly instead of untyped fallbacks
(Written by Copilot)
* comments
Co-authored-by: Copilot <copilot@github.com>
* Simplify further
Co-authored-by: Copilot <copilot@github.com>
---------
Co-authored-by: Copilot <copilot@github.com>
* Use URI for workingDirectory across agent host layer
- Change IAgentCreateSessionConfig.workingDirectory and
IAgentSessionMetadata.workingDirectory from string to URI
- Convert file paths to URI at SDK boundary (CopilotAgent)
- Convert protocol strings to agenthost:// URIs at protocol client boundary
- Convert agenthost:// URIs back to file:// at protocol client on outgoing
- Update resolveWorkingDirectory callback to return URI
- Use extUriBiasedIgnorePathCase.isEqualOrParent for path containment
- Use generateUuid() instead of crypto.randomUUID()
- Add CopilotAgentSession tests and SessionWrapperFactory pattern
- Register all event subscription disposables properly
(Written by Copilot)
* Tweak
* Fix test
Add 7 new tests covering multi-client scenarios:
- sessionAdded/sessionRemoved notifications broadcast to all clients
- Cross-client message dispatch (client B sends on client A's session)
- Full tool progress updates delivered to both subscribers
- Action scoping: unsubscribed client gets no actions but still gets notifications
- Late subscriber gets current state via snapshot
- Cross-client permission flow (client B confirms tool started by client A)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds a SQLite DB for session-specific metadata. Stores edits in there.
It can _almost_ restore edits, but I still need to make undoStops be
similarly persisted. That is a project for later this evening.
* agentHost: initial queuing/steering data flows
* agentHost: ui side for queued messages
Steering messages still don't quite work yet, I need to hook up some more stuff in the CLI for that I believe.
* comments
* rm dead code
* Fix loading sessions that were created by a previous instance of the server
Co-authored-by: Copilot <copilot@github.com>
* Add handleRestoreSession to agentHostMain side effects
Wire up the handleRestoreSession method in the utility process
agent host entry point, delegating to AgentService which forwards
to AgentSideEffects. This was missing after the interface was
updated to require session restore support.
* Address Copilot review: wrap backend errors, use Cancelled for interrupted turns
- Wrap agent.listSessions() and agent.getSessionMessages() calls in
try/catch so raw backend errors become ProtocolErrors instead of
leaking stack traces to clients.
- Use TurnState.Cancelled instead of TurnState.Complete for
interrupted/dangling turns during session restoration.
- Update test assertions to match new interrupted turn state.
(Written by Copilot)
---------
Co-authored-by: Copilot <copilot@github.com>
* Keep agent host alive while there are active websocket connections
Instead of shutting it down whenever there are no agents running
Co-authored-by: Copilot <copilot@github.com>
* Fix disposable handling
---------
Co-authored-by: Copilot <copilot@github.com>
This commit implement RFC 9728/6750-inspired authentication for the
agent host. This is a working prototype, although before merging this
I'll pull this stuff up to the protocol itself rather than being
extension methods.
- Migrates to use AHP types that are synced via `npx tsx scripts/sync-agent-host-protocol.ts`
- One big churn was migrating out of URIs as rich objects in the protocol.
We can't really shove our own `$mid`-type objects in there. I also explored doing a
generated translation layer but I had trouble getting one I was happy with.
- This tightens up some type safety in general and fixes some areas where vscode had
silently/sloppily diverged from the protocol types.
* Copy vscode's node.pty
* And ripgrep
* And thsi
* Connect to remote agent hosts via setting chat.remoteAgentHosts
* This
* Fix
* Cleanup
* Rearrange, add unit tests