Repository navigation
Python: .NET: Keep A2A streaming session state current - #8646
SergeyMenshykh merged 6 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Whitespace-only context IDs can bypass the new unbound-session validation.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
What changed in this PR
Improves A2A continuation session validation and preserves streaming session state during interrupted enumeration.
Changes:
- Requires context-bound sessions for continuation tokens.
- Updates session state before yielding streaming responses.
- Adds regression tests for continuation and streaming behavior.
| File | Description |
|---|---|
dotnet/src/Microsoft.Agents.AI.A2A/A2AAgent.cs |
Implements continuation validation and incremental session updates. |
dotnet/tests/Microsoft.Agents.AI.A2A.UnitTests/A2AAgentTests.cs |
Adds continuation and interrupted-stream coverage. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: Findings reported
Scope: full PR (2 commit(s)): cf4c6f6734fa, a0bea7bcae57
Model: gpt-5.6-sol-fast
Overview
The change consistently requires a context-bound session for continuation calls and moves streaming session updates ahead of each yielded update, with strong regression coverage for mismatched contexts and early abandonment. The shared continuation guard and pre-yield validation prevent several cross-context failure modes. Two residual gaps remain: context-less continuation responses bypass the new binding guarantee, and artifact-only updates can erase persisted task state during an interrupted reconnection.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
2 verified findings remained after source verification (2 medium) across 1 file. Details are attached to the affected lines below.
Affected areas: dotnet/src/Microsoft.Agents.AI.A2A/A2AAgent.cs
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Motivation & Context
A streamed A2A response could be yielded before its context ID was checked against the context already associated with the provided session. This could allow callers to observe an update from a different context before the mismatch was reported.
Description & Review Guide
Related Issue
N/A.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.