Repository navigation
Python: expose provider call IDs on FunctionInvocationContext - #10047
Open
Daniel Quintas (danielquintas8) wants to merge 1 commit into
Open
Daniel Quintas (danielquintas8) wants to merge 1 commit into
Daniel Quintas (danielquintas8) wants to merge 1 commit into
Conversation
Daniel Quintas (danielquintas8)
deployed
to
github-app-auth
November 3, 2026 15:42 — with
GitHub Actions
Active
Daniel Quintas (danielquintas8)
marked this pull request as ready for review
November 3, 2026 15:43
Daniel Quintas (danielquintas8)
had a problem deploying
to
github-app-auth
November 3, 2026 15:43 — with
GitHub Actions
Error
Author
|
@microsoft-github-policy-service agree |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation & Context
A tool proxy needs the provider call ID to correlate an execution with the recorded call and its result. The automatic Python loop currently exposes that ID only through an undocumented metadata key on the function-middleware path. A context-aware tool otherwise has no supported property for it.
Description & Review Guide
What are the major changes? Add the read-only
FunctionInvocationContext.call_idproperty. Bind it before function middleware and before the tool body executes. StandaloneFunctionTool.invokecalls use their existingtool_call_idargument; omitting it yieldsNone, including when a context is reused. The existing middleware metadata keys remain available.What is the impact of these changes? Tools can read the provider ID without installing pass-through middleware. The property exposes the ID alone. Call payloads are not copied, and ID generation, call/result pairing, and argument handling retain their existing paths. Local validation passed the package build, 9,330 core tests, syntax checks, strict source Pyright, and all five test type checkers. Local code review and adversarial review passed with no findings. Credential-dependent integration tests were not run.
What do you want reviewers to focus on? Check whether this narrow property is the right public API, and whether binding it at middleware dispatch and invocation covers the intended execution paths. The design is a proposal; I can change its shape or wiring to follow the core team's direction.
Related Issue
Fixes #9454
The issue remains in planning; explicit implementation agreement has not been recorded. This PR offers a concrete proposal for that discussion.
AI Assistance
AI assistance details: design, implementation, regression tests, documentation, and this PR description.
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.