Python: Support async credentials in FoundryToolbox - #7208
Merged
Conversation
Contributor
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for using asynchronous Azure credentials with FoundryToolbox by updating the internal httpx authentication hook to handle both sync and async get_token implementations, and extends unit tests to cover the async-credential path.
Changes:
- Update
_ToolboxAuthto support bothTokenCredentialandAsyncTokenCredentialviaasync_auth_flow(and a sync flow for sync clients). - Expand
FoundryToolbox’s public constructor typing/docs to accept async credentials. - Add/adjust tests to validate bearer token injection for both sync and async credentials, plus sync-flow rejection of async credentials.
Show a summary per file
| File | Description |
|---|---|
| python/packages/foundry_hosting/agent_framework_foundry_hosting/_toolbox.py | Implements async-credential support in _ToolboxAuth and updates FoundryToolbox’s credential typing/docs. |
| python/packages/foundry_hosting/tests/test_toolbox.py | Adds coverage for async credentials and separates async vs sync auth-flow tests. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Low
cecheta
force-pushed
the
toolbox-async-auth
branch
2 times, most recently
from
July 22, 2026 14:50
5080e9a to
5ff6328
Compare
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
cecheta
force-pushed
the
toolbox-async-auth
branch
from
July 23, 2026 13:07
5ff6328 to
47e05cf
Compare
eavanvalkenburg
approved these changes
Jul 23, 2026
eavanvalkenburg
enabled auto-merge
July 23, 2026 13:35
giles17
approved these changes
Jul 23, 2026
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
Description & Review Guide
Adds support for async credentials to FoundryToolbox.
Related Issue
Fixes #7207
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.