Repository navigation
[Agent Server] Persist identity fields in checkpoints - #49765
Slai.life (huong8373tt-beep) wants to merge 3 commits into
Conversation
|
Thank you for your contribution Slai.life (@huong8373tt-beep)! We will review the pull request and get back to you soon. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 10 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
🟡 Changes recommended
The new deepcopy can raise an uncaught TypeError for generator-valued extensions, causing live responses to fail instead of safely skipping the checkpoint.
1 open issue
What changed in this PR
This PR addresses #49475 by applying terminal-response identity normalization to checkpoint persistence, making checkpoints independently storable without exposing checkpoint events on the wire.
Changes:
- Forward resolved agent, model, session, and conversation identity to checkpoint persistence.
- Normalize checkpoint snapshots and persist the background mode flag.
- Add a regression test asserting the persisted checkpoint payload includes identity fields.
| File | Description |
|---|---|
sdk/agentserver/azure-ai-agentserver-responses/tests/unit/test_checkpoint.py |
Adds checkpoint identity and background-mode assertions. |
sdk/agentserver/azure-ai-agentserver-responses/azure/ai/agentserver/responses/hosting/_orchestrator.py |
Normalizes checkpoint payloads and forwards resolved identity from both checkpoint call sites. |
Review effort: Balanced
|
Addressed the Copilot review finding in Checkpoint snapshot preparation is now inside the existing serialization guard. If a response extension contains a generator or another value that cannot be deep-copied, checkpointing returns the prior snapshot without failing the live response. Added Validation:
The test environment required the repository's current |
|
Addressed the Azure Pipelines MyPy failure reported by the analyzer: |
|
Revalidated the checkpoint change at the current head: |
|
The current Azure pipeline run completed all build, documentation, MyPy, lint, and test jobs successfully. The only failure is the repository dependency analyzer, which reports that |

Summary
Fixes #49475.
Checkpoint writes from a
ResponseEventStream(response_id=...)now use the same response-snapshot normalization as terminal persistence. This stamps the resolved response identity beforeupdate_response, including:response_idbackgroundmodeThe change is limited to checkpoint persistence and does not expose checkpoint events on the wire. Snapshot preparation remains inside the existing failure guard, so an extension value that cannot be deep-copied (for example, a generator) safely skips the checkpoint without breaking the live response.
Validation
tests/unit/test_checkpoint.py— 9 passed.tests/unit/test_event_copy_reuse.py— 27 passed.python -m compileall -q sdk/agentserver/azure-ai-agentserver-responses/azure tests— passed.python -m build --wheel— passed.git diff --check— passed.--basetempbecause the Windows host had a stale C-drive temporary link with insufficient access; no production dependency was changed.The targeted regression covers an unseeded checkpoint and asserts that the independently persisted payload contains the resolved identity and background mode. It also covers generator-valued extensions and verifies that checkpoint preparation failures are swallowed without affecting the live response.
Disclosure and authorization
Slai Agent Runtime performed the investigation, implementation, and test execution. The account owner authorized this contribution and is responsible for its content.