Repository navigation
Python: avoid spurious warnings for staged approvals - #8895
Eduard van Valkenburg (eavanvalkenburg) merged 2 commits into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Warning suppression is overly broad, and streaming replay plus distinct legacy-ID behavior lack coverage.
Review effort: Balanced
Findings: 1
Open (3)
What changed in this PR
Suppresses redundant approval identity warnings after staged decisions are consumed.
Changes:
- Passes staged approval IDs into response binding.
- Expands approval/rejection replay assertions.
| File | Description |
|---|---|
python/packages/core/agent_framework/_tools.py |
Suppresses warnings for staged approval IDs. |
python/packages/core/tests/core/test_harness_tool_approval.py |
Tests quiet resumes and consumed replays. |
💡 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)): d17b8563e2fd
Model: gpt-5.6-sol
Overview
The change suppresses the redundant second-pass warning after staged approval decisions have already been validated and consumed, while retaining authoritative session binding and fail-closed removal of unmatched responses. The updated test covers approval and rejection in both initial streaming and non-streaming resume paths, including exactly-once execution and a warning on subsequent consumed replay. No new publishable issue remains after deduplication against the existing unresolved feedback.
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
Approving or rejecting a tool call with a response created directly from the returned request and the same
AgentSessioncan log an incorrect approval occurrence-identity mismatch, even though the decision is handled correctly.Batch staging has already validated the decision and consumed the pending request. The later binding pass revisits the original input, cannot find the consumed request, and emits a misleading warning. This fix suppresses only that redundant diagnostic.
Description & Review Guide
Related Issue
Reported directly; no linked GitHub 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.