Repository navigation
fix(doctor): apply the ambient-auth exemption to the doctor key check - #4536
Merged
Merged
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
⚙️ Agent run details
|
PR Code Suggestions ✨No code suggestions found for the PR. ⚙️ Agent run details
|
IsmaelMartinez
approved these changes
Oct 30, 2026
IsmaelMartinez
left a comment
Collaborator
There was a problem hiding this comment.
Thanks @Kiddo4993 for moving the ambient-auth exemption into a shared helper so doctor no longer fails Bedrock IRSA/IMDS and Azure setups when the ping succeeds, approving and merging.
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.
User description
Fixes #4531.
pr-agent doctorfailed its key check, and exited with code 1, for Bedrock setups that use IRSA/IMDS. The same happened with Azure. In both cases the model ping succeeded. The cause was that the ambient-auth / custom-endpoint exemption lived only inmissing_provider_key_env_vars(), which the GitHub Action runner uses._check_provider_key(), whichdoctoruses, did not have it.Changes
_uses_ambient_auth_or_custom_endpoint(provider). It coversazure_ad.client_id,bedrock*/azure*providers, and<provider>.api_base. The rules are unchanged._check_provider_key()now uses the helper after the "real key found" branch. In those setups it reportsno static key for '<provider>' (ambient auth or custom endpoint); ping decidesas a passing check, and the ping then decides the result.missing_provider_key_env_vars()now just relies on_check_provider_key().doctorand the runner share one decision path, so the runner's behaviour stays the same.Tests
doctorexits 0 and reports 3 of 3 checks passed.*_defers_to_the_run) and the placeholder / missing-key failure tests for OpenAI are unchanged and should still pass.Fixes #4531
Happy to adjust anything or close it if it isn't a fit.
PR Type
Bug fix, Tests
Description
Fix
doctorfailures with ambient authentication.Share credential exemptions with GitHub Action checks.
Test successful Bedrock and Azure diagnostics.
Diagram Walkthrough
File Walkthrough
doctor.py
Share credential exemptions across doctor and runnerpr_agent/doctor.py
_uses_ambient_auth_or_custom_endpoint()._check_provider_key()after checking for a usablestatic key.
validation to the model ping.
missing_provider_key_env_vars(),preserving runner behavior.
test_cli_doctor.py
Cover successful doctor checks with ambient authenticationtests/unittest/test_cli_doctor.py
static keys.
checks.
⚙️ Agent run details