Repository navigation
feat: Capture A2A response summary in session events - #373
Merged
Merged
Conversation
Add TaskID, FinalStatus, Artifact, and ErrorMessage to A2AExtension. The a2a-parser OnResponse now parses both SSE streams (message/stream) and plain JSON-RPC responses (message/send) to extract: - Final status (completed/failed/canceled) - Artifact text (the agent's actual answer) - Error message (failure reason) - Task ID (for multi-turn correlation) This enables debugging agent behavior from session events without reading raw SSE streams. Session events now show what the agent said, not just that it responded with 200. Signed-off-by: Hai Huang <[email protected]> Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Hai Huang <[email protected]>
3 of 9 tasks
boazdavid
added a commit
to boazdavid/cortex
that referenced
this pull request
Nov 24, 2026
…known, and fix a real regression in the zero-prompt-total gate Two more findings from clawgenti's re-review: - The currency fix only gated PluginSpendMicros (basis usd). PluginSpendUnknownMicros is "not money", but it is still one number, and a USD figure and a differently- priced currency's figure summed into it is just as mixed. Same gate now applies there. - The zero-prompt-total gate in InferenceParser.accountant asked whenever pctx.ReportedOps() was non-empty, reasoning that the pass before any data arrives has no ops either. That was wrong: a structural op (tool-prune's removal, say) reports during OnRequest, before the response exists, so that pass's ops list is not empty either — and asking there calls Host.Compute with an inference extension that is still all zeros, which Compute latches forever, so the real counts that arrive on a later pass are never priced at all. Reproduced by clawgenti; fixed by gating on pctx.StatusCode (set once, when the response is read) instead of on ReportedOps. Added a regression test pinning the exact two-pass sequence. Also dismissed the same 2 alerts' re-raised instances (rossoctl#365, rossoctl#370) after they shifted line following the rebase onto main — the earlier dismissal (rossoctl#372, rossoctl#373) stopped applying once that commit was superseded. Assisted-By: Claude Sonnet 5 <[email protected]> Signed-off-by: DAVID BOAZ <[email protected]>
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
Session events for A2A responses now include the agent's actual answer, final status, and error message — enabling debugging of agent behavior without reading raw SSE streams.
Changes
A2AExtensiongains 4 new fields:TaskID,FinalStatus,Artifact,ErrorMessagea2a-parser.OnRequestextractstaskIdfrom request paramsa2a-parser.OnResponseparses both SSE streams (message/stream) and plain JSON-RPC (message/send) to extract final status, artifact text, and error messageBefore / After
Before:
{"a2a":{"method":"message/stream","rpcId":"...","sessionId":"..."}, "statusCode":200, "durationMs":4001}After:
{"a2a":{"method":"message/stream","rpcId":"...","sessionId":"...","taskId":"task-1","finalStatus":"completed","artifact":"The weather in New York is sunny, 72 F"}, "statusCode":200, "durationMs":4001}Test plan
Assisted-By: Claude (Anthropic AI) [email protected]