Repository navigation
Python: Improve settled approval matching - #9535
westey (westey-m) wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Closed-request duplicates can incorrectly cause completed mixed-batch history replay to fail validation.
1 open issue
What changed in this PR
Strengthens Python tool-approval matching to prevent duplicate approval IDs from enabling execution without an authoritative session.
Changes:
- Tracks pending approval responses by object identity.
- Repeats filtering after mixed-batch reclassification.
- Adds regression coverage and updates the specification.
| File | Description |
|---|---|
python/packages/core/tests/core/test_function_invocation_logic.py |
Adds streaming, non-streaming, and agent regression cases. |
python/packages/core/agent_framework/_tools.py |
Updates pending-response tracking and repeated filtering. |
docs/specs/004-python-function-calling-loop.md |
Links the new approval regression test. |
Review effort: Balanced
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: Findings reported
Scope: full PR (1 commit(s)): 1f55d3e2d403
Model: gpt-5.6-sol
Overview
The change strengthens no-session approval filtering by tracking settlement per response object and repeatedly reclassifying duplicate-ID histories until filtering stabilizes. Session-backed authorization, hosted approvals, strict-True execution, caller immutability, and streaming parity remain guarded by shared code paths and focused tests. One edge case remains: a completed mixed transcript whose terminal result precedes a stale approval response is reclassified as incomplete instead of replaying inertly.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
1 verified finding remained after source verification (1 medium) across 1 file. Details are attached to the affected lines below.
Affected areas: python/packages/core/agent_framework/_tools.py

Motivation & Context
Description & Review Guide
Improve settled approval matching.
Related Issue
Fixes #
AI Assistance
AI assistance details:
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.