The existing abort test mocked the executor to always reject, meaning it
would pass even if the abort wiring was broken. Add a test that actually
fires the caller's AbortSignal and asserts it propagates through the
abortListener -> session.abort() -> internal AbortController -> executor
chain.
Introduce LocalSubagentProtocol and RemoteSubagentProtocol that implement
AgentProtocol, wrapping LocalAgentExecutor and A2A client streaming
respectively. LocalSubagentSession and RemoteSubagentSession extend
AgentSession and are the public entry points.
- LocalSubagentProtocol: translates SubagentActivityEvent -> AgentEvent
(THOUGHT_CHUNK->message/thought, TOOL_CALL_START->tool_request,
TOOL_CALL_END->tool_response, ERROR->error). Accepts optional
rawActivityCallback for rich SubagentProgress display without losing
displayName/errorType detail that AgentEvent types do not carry.
- RemoteSubagentProtocol: wraps A2A sendMessageStream, maintains
contextId/taskId session state, tracks SubagentProgress per chunk
for error recovery, and returns a ToolResult with proper
SubagentProgress as returnDisplay.
- LocalSubagentInvocation: now uses LocalSubagentSession internally,
preserving all existing SubagentProgress display logic via
rawActivityCallback. External AbortSignal wired through session.abort().
- RemoteAgentInvocation: now uses RemoteSubagentSession, subscribing
to message events for live progress updates.
- SubagentToolWrapper and SubagentTool: add optional onAgentEvent
callback for future parent session observability (currently unused,
wired through invocation constructors to avoid a second pass later).
- index.ts: export LocalSubagentSession and RemoteSubagentSession.
No behavioral change to SubagentProgress display or ToolResult output.