New invocation class that delegates to RemoteSubagentSession instead of
directly managing A2A client streaming. Existing RemoteAgentInvocation is
untouched — this will be wired in behind a feature flag in a later PR.
Key behaviors:
- Static sessionState map persists A2A contextId/taskId across invocations
- Subscribes to session message events for live SubagentProgress updates
- Detects post-getResult abort and surfaces proper error state
- Includes partial output in error display via getLatestProgress()
- Properly cleans up abort listeners and subscriptions in finally block
Also adds initialState param and getSessionState() to
RemoteSubagentProtocol/RemoteSubagentSession for cross-invocation
state persistence.
Introduces RemoteSubagentProtocol (implements AgentProtocol) and
RemoteSubagentSession (extends AgentSession) to wrap the A2A remote
agent streaming client behind the unified agent session interface.
- Manages persistent session state (contextId, taskId) across sends
- Handles auth setup via A2AAuthProviderFactory per agent definition
- Uses A2AResultReassembler for response chunk processing
- Maps A2A streaming events to typed AgentEvent emissions
- Exposes getResult() and getLatestProgress() for result retrieval
- Guards against concurrent send() with clear error messaging
- Includes comprehensive test suite (776 lines)
Part of the AgentSession unification effort to expose all agents
(interactive, non-interactive, subagents) through the same contract.
Bug: b/22700