Repository navigation
Python: tool role testing - #9323
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The tests comprehensively cover the reported regression without production-code changes.
0 open findings
What changed in this PR
Adds regression coverage for mixed Host tool results and approval decisions during workflow resume.
Changes:
- Verifies role grouping and request order across streaming, partial, and checkpointed resumes.
- Verifies approved/rejected tools execute exactly once without replaying Host results.
| File | Description |
|---|---|
python/packages/core/tests/workflow/test_agent_executor_tool_calls.py |
Adds focused mixed-resume regression tests and a capturing test agent. |
🧠 Review effort: Balanced
💡 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: No findings
Scope: full PR (1 commit(s)): 34b8461569d5
Model: gpt-5.6-sol
Overview
This test-only PR adds focused regression coverage for mixed Host-tool and approval responses across streaming, non-streaming, partial-response, and checkpoint-restoration paths. The tests deliberately reverse response submission, verify original request order and adjacent role grouping, exercise the real function loop, and assert exactly-once execution and input immutability. No publishable Critical, High, or Medium defect was established.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.
Motivation & Context
An issue reported that resuming a workflow with both Host tool results and approval decisions incorrectly placed the entire batch in a user-role message. Although #8751 fixed this behavior, existing tests do not directly assert the mixed-role messages passed from
AgentExecutorto its wrapped agent. This PR adds focused regression coverage for content roles, adjacent grouping, and original request order across streaming and non-streaming resumes, including partial responses and checkpoint restoration.Description & Review Guide
Related Issue
Fixes #8700
AI Assistance
AI assistance details: Used Copilot with GPT-6.1 Sol to find the PR that solved the issue.
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.