| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
Reviewers: 5 | Confidence: 80% | Result: All clear
Reviewed: Correctness, Security Reliability, Test Coverage, Failure Modes, Design Approach
Automated review by moonbox3's agents
Sorry, something went wrong.
There was a problem hiding this comment.
This PR fixes stateless replay for reasoning-model Responses by ensuring tool-call history that was originally paired with server-scoped reasoning items is not replayed “orphaned” (which Foundry rejects with HTTP 400), covering both hosted MCP calls and client-side function calls across workflow/multi-agent boundaries.
Changes:
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| python/packages/openai/agent_framework_openai/_chat_client.py | Drops reasoning-paired tool-call items atomically during stateless replay, including completed function-call loops. |
| python/packages/openai/tests/openai/test_openai_chat_client.py | Updates unit coverage to assert completed reasoning-paired function-call history is stripped without storage, while active loops remain. |
| python/packages/foundry/tests/foundry/test_foundry_agent.py | Adds deterministic workflow regression to ensure cross-agent replay doesn’t send orphaned function_call items. |
| python/packages/foundry_hosting/tests/test_responses_int.py | Adds deterministic hosted-server regression ensuring second turn doesn’t replay mcp_call without its paired reasoning item. |
Sorry, something went wrong.
There was a problem hiding this comment.
Reviewers: 5 | Confidence: 87% | Result: All clear
Reviewed: Correctness, Security Reliability, Test Coverage, Failure Modes, Design Approach
Automated review by moonbox3's agents
Sorry, something went wrong.
|
Why did we choose to drop the function call and result pair instead of replaying the reasonings? |
Sorry, something went wrong.
Key decisions: - Request encrypted reasoning on client-managed Responses calls while preserving caller include values. - Store encrypted payloads in Content.protected_data and reconstruct one provider reasoning item per reasoning id. - Replay active and completed function call/result groups; retain continuation-owned history behavior and the existing orphan-safe MCP path. Files changed: - python/packages/openai/agent_framework_openai/_chat_client.py - python/packages/openai/tests/openai/test_openai_chat_client.py Next iteration: - Extend encrypted reasoning preservation to streaming and framework serialization boundaries. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Key decisions: - Capture encrypted reasoning from terminal streamed output items in Content.protected_data. - Preserve summary and private reasoning as distinct framework contents while reconstructing one provider reasoning item per id. - Prove replay after Message JSON and workflow checkpoint round trips, including encrypted-only and completed function groups. Files changed: - python/packages/core/agent_framework/_types.py - python/packages/openai/agent_framework_openai/_chat_client.py - python/packages/openai/tests/openai/test_openai_chat_client.py Next iteration: - Extend lossless stateless reasoning replay to hosted MCP call/output groups. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Key decisions: - Preserve hosted MCP call/output groups in client-managed history instead of deleting them when reasoning cannot be reconstructed. - Keep call/result coalescing and orphan-result exclusion intact, while retaining continuation-owned duplicate avoidance. - Cover completed, active, and multi-call reasoning groups plus the public outgoing request boundary. Files changed: - python/packages/openai/agent_framework_openai/_chat_client.py - python/packages/openai/tests/openai/test_openai_chat_client.py Next iteration: - Preserve middleware-terminated and parallel function groups atomically. - Add preflight rejection for non-replayable reasoning groups in the dedicated validation slice. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Key decisions: - Return ordinary function results when middleware terminates a loop, removing the provider-specific durable marker. - Preserve every parallel call and available sibling result as one encrypted reasoning group in stateless replay. - Prove successful and policy-blocked batches through the public two-agent Foundry workflow and outgoing HTTP boundary. Files changed: - python/packages/core/agent_framework/_tools.py - python/packages/core/tests/core/test_function_invocation_logic.py - python/packages/openai/tests/openai/test_openai_chat_client.py - python/packages/foundry/tests/foundry/test_foundry_agent.py Next iteration: - Add preflight rejection for non-replayable and partially compacted reasoning groups. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Key decisions: - Validate client-managed reasoning groups after compaction and report every affected reasoning and call identifier before transport. - Permit service-owned continuation and fully excluded atomic groups while rejecting partial compaction projections. - Surface encrypted-reasoning capability failures without lossy retries. Files changed: - python/packages/openai/agent_framework_openai/_chat_client.py - python/packages/openai/tests/openai/test_openai_chat_client.py Next iteration: - Run the resource-specific Foundry proof and finish PR microsoft#7233; that live proof remains intentionally local and requires the configured developer resource. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
I fixed this in latest commits. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Motivation & Context
Reasoning-model responses can bind a reasoning item to a tool-call item. During stateless replay, Agent Framework strips response-scoped reasoning items, but the client-side MCP path continued to serialize the paired function_call and function_call_output. Foundry rejects that orphaned call with HTTP 400 in multi-agent workflows. The earlier fix in #6907 covered hosted mcp_call items but not client-side MCP tools represented as function calls.
Description & Review Guide
Related Issue
Fixes #6074
No other open PR exists for this issue. This completes the client-side function-call path that remained after #6907.
Contribution Checklist