fix: detect copilot and qwen-oauth providers in /model picker - #9810
Merged
Conversation
Seed copilot credentials from resolve_copilot_token() in the credential pool's _seed_from_singletons(), alongside the existing anthropic and openai-codex seeding logic. This makes copilot appear in the /model provider picker when the user authenticates solely through gh auth token. Cherry-picked from PR #9767 by Marvae.
Seed qwen-oauth credentials from resolve_qwen_runtime_credentials() in _seed_from_singletons(). Users who authenticate via 'qwen auth qwen-oauth' store tokens in ~/.qwen/oauth_creds.json which the runtime resolver reads but the credential pool couldn't detect — same gap pattern as copilot. Uses refresh_if_expiring=False to avoid network calls during discovery.
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.
Summary
Fixes two gaps in
/modelprovider detection where providers with dynamic credential resolution weren't being detected bylist_authenticated_providers().Copilot (cherry-picked from PR #9767 by @Marvae): Users authenticating solely via
gh auth token(no env vars set) weren't seeing copilot in the provider picker. Seeds copilot credentials fromresolve_copilot_token()in the credential pool's_seed_from_singletons().Qwen OAuth (new): Same gap pattern. Users authenticating via
qwen auth qwen-oauthstore tokens in~/.qwen/oauth_creds.json. The runtime resolver reads this file, but the credential pool had no handler for it. Seeds qwen-oauth credentials fromresolve_qwen_runtime_credentials(refresh_if_expiring=False)to avoid network calls during discovery.Both follow the existing pattern established by anthropic, nous, and openai-codex seeding.
Changes
agent/credential_pool.py— Add copilot and qwen-oauth branches in_seed_from_singletons()tests/agent/test_credential_pool.py— 4 new tests (2 per provider: token found → seeded, no token → empty)Test plan
All 4 new tests pass. 1 pre-existing failure (
test_explicit_reset_timestamp_overrides_default_429_ttl) is unrelated and fails on current main.Closes #9768. Supersedes #9767 (cherry-picked with contributor authorship preserved).