Skip to content

feat: Capture A2A response summary in session events - #373

Merged
huang195 merged 1 commit into
rossoctl:mainfrom
huang195:feat/a2a-response-summary
May 6, 2026
Merged

huang195 merged 1 commit into
rossoctl:mainfrom
huang195:feat/a2a-response-summary

Conversation

@huang195

@huang195 huang195 commented May 6, 2026

Copy link
Copy Markdown
Member

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

  • A2AExtension gains 4 new fields: TaskID, FinalStatus, Artifact, ErrorMessage
  • a2a-parser.OnRequest extracts taskId from request params
  • a2a-parser.OnResponse parses both SSE streams (message/stream) and plain JSON-RPC (message/send) to extract final status, artifact text, and error message

Before / 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

  • All existing A2A parser tests pass
  • Full binary builds
  • E2E: deploy weather agent, send query, verify session event shows artifact

Assisted-By: Claude (Anthropic AI) [email protected]

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]>
@huang195
huang195 merged commit d6de7cb into rossoctl:main May 6, 2026
18 checks passed
@huang195
huang195 deleted the feat/a2a-response-summary branch May 20, 2026 18:05
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant