Skip to content

Python: Support async credentials in FoundryToolbox - #7208

Merged
eavanvalkenburg merged 4 commits into
microsoft:mainfrom
cecheta:toolbox-async-auth
Jul 23, 2026
Merged

Python: Support async credentials in FoundryToolbox#7208
eavanvalkenburg merged 4 commits into
microsoft:mainfrom
cecheta:toolbox-async-auth

Conversation

@cecheta

@cecheta cecheta commented Jul 20, 2026

Copy link
Copy Markdown
Member

Motivation & Context

Description & Review Guide

  • What are the major changes?
  • What is the impact of these changes?
  • What do you want reviewers to focus on?

Adds support for async credentials to FoundryToolbox.

Related Issue

Fixes #7207

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

Copilot AI review requested due to automatic review settings July 20, 2026 10:54
@giles17 giles17 added the python Usage: [Issues, PRs], Target: Python label Jul 20, 2026
@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/foundry_hosting/agent_framework_foundry_hosting
   _toolbox.py820100% 
TOTAL45533446890% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
9388 33 💤 0 ❌ 0 🔥 2m 29s ⏱️

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 _ToolboxAuth to support both TokenCredential and AsyncTokenCredential via async_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

Comment thread python/packages/foundry_hosting/agent_framework_foundry_hosting/_toolbox.py Outdated
@cecheta
cecheta force-pushed the toolbox-async-auth branch 2 times, most recently from 5080e9a to 5ff6328 Compare July 22, 2026 14:50
@cecheta
cecheta temporarily deployed to github-app-auth July 22, 2026 14:50 — with GitHub Actions Inactive
Comment thread python/packages/foundry_hosting/agent_framework_foundry_hosting/_toolbox.py Outdated
@cecheta
cecheta force-pushed the toolbox-async-auth branch from 5ff6328 to 47e05cf Compare July 23, 2026 13:07
@cecheta
cecheta temporarily deployed to github-app-auth July 23, 2026 13:07 — with GitHub Actions Inactive
@eavanvalkenburg
eavanvalkenburg added this pull request to the merge queue Jul 23, 2026
Merged via the queue into microsoft:main with commit 217912a Jul 23, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: [Feature]: Support async credentials in FoundryToolbox

4 participants