Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #123 +/- ##
==========================================
+ Coverage 96.22% 96.38% +0.15%
==========================================
Files 28 28
Lines 1219 1245 +26
==========================================
+ Hits 1173 1200 +27
+ Misses 46 45 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for Azure AD token-based authentication via a token_provider that can be passed through bots into the OpenAI/Anthropic SDK clients, and extends the browsing toolchain to accept Azure AD tokens at runtime.
Changes:
- Add
token_providerplumbing fromMicroBot(and sub-agents) intoOpenAIApi/AnthropicApiclient construction. - Add Azure AD token injection support for the browser tool (Docker) and update its LLM initialization to accept an AD token.
- Add/extend unit tests and introduce authentication documentation.
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| test/tools/tool_definitions/test_microbot_sub_agent.py | Updates test bot factory to include token_provider. |
| test/llm/test_openai_api.py | Adds init tests for missing auth and token-provider Azure client creation. |
| test/llm/test_anthropic_api.py | Adds init tests for missing auth and token-provider Foundry client creation. |
| test/bot/test_microbot.py | Adds tests for explicit and env-driven token provider behavior. |
| test/bot/test_browsing_bot.py | Adds unit tests for token injection + safer shell quoting. |
| src/microbots/tools/tool_definitions/microbot_sub_agent.py | Passes token_provider to sub-bot creation. |
| src/microbots/tools/tool_definitions/browser-use/browser.py | Builds ChatAzureOpenAI with optional azure_ad_token. |
| src/microbots/tools/tool_definitions/browser-use.yaml | Documents optional API key and runtime token injection. |
| src/microbots/llm/openai_api.py | Adds token_provider option and AzureOpenAI client support. |
| src/microbots/llm/anthropic_api.py | Adds token_provider option and AnthropicFoundry client support. |
| src/microbots/bot/WritingBot.py | Adds token_provider passthrough. |
| src/microbots/bot/ReadingBot.py | Adds token_provider passthrough. |
| src/microbots/bot/LogAnalysisBot.py | Adds token_provider passthrough. |
| src/microbots/bot/BrowsingBot.py | Adds token_provider, safer quoting, and token export before browser run. |
| src/microbots/MicroBot.py | Adds env-driven token provider auto-creation and passes it into LLMs. |
| requirements.txt | Adds azure-identity dependency. |
| docs/authentication.md | Adds auth documentation for API keys vs Azure AD token auth. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This PR adds support for Azure AD token-based authentication via a token_provider that can be passed through bots into the OpenAI/Anthropic SDK clients, and extends the browsing toolchain to accept Azure AD tokens at runtime.
Changes: