SIGN IN SIGN UP

Unify agentHost server-side dispatch: remove IProtocolSideEffectHandler (#306158)

* 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 <[email protected]>

* Simplify further

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
R
Rob Lourens committed
94c7bf8213beb59e3181fdb61992a032fc65e9a2
Parent: bf71412
Committed by GitHub <[email protected]> on 3/30/2026, 2:07:20 AM