fix(auth): set active_provider after hermes auth add qwen-oauth - #37602
Closed
AhmetArif0 wants to merge 1 commit into
Closed
fix(auth): set active_provider after hermes auth add qwen-oauth#37602AhmetArif0 wants to merge 1 commit into
AhmetArif0 wants to merge 1 commit into
Conversation
hermes auth add qwen-oauth called pool.add_entry() but never wrote to providers["qwen-oauth"] or set active_provider in auth.json. _model_section_has_credentials() checks get_active_provider() first; with active_provider unset and no api_key_env_vars configured for oauth_external providers, the setup wizard reported "No inference provider configured" even after a successful Qwen CLI OAuth login. Add _mark_qwen_oauth_active() in auth.py: writes a minimal provider state entry (base_url for display only) and calls _save_provider_state() to set active_provider. The function deliberately does not copy the api_key — that lives in the Qwen CLI credential file managed by _save_qwen_cli_tokens / resolve_qwen_runtime_credentials and must not be duplicated in auth.json where it would become stale. pool.add_entry() is retained so "hermes auth list" continues to show the entry. Runtime credential resolution continues to use resolve_qwen_runtime_credentials. Mirrors the fix applied to openai-codex (NousResearch#37517) and xai-oauth (NousResearch#37576).
Contributor
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.
Problem
hermes auth add qwen-oauthcalledpool.add_entry()but never wrote toproviders["qwen-oauth"]or setactive_providerinauth.json. The setup wizard reported "No inference provider configured" even after a successful Qwen CLI OAuth login.Root cause
Same pattern as
openai-codex(#37517),xai-oauth(#37600), andgoogle-gemini-cli(#37601):pool.add_entry()only writes the credential-pool entry;active_provideris never set.Qwen OAuth tokens live in the Qwen CLI credential file (read by
resolve_qwen_runtime_credentials()), not in auth.json. Runtime resolution works fine; only setup/status detection was broken.Fix
Add
_mark_qwen_oauth_active()inhermes_cli/auth.py: writes a minimal provider-state entry (base_urlfor display only) and calls_save_provider_state()to setactive_provider.The function deliberately does not copy the
api_key— that lives in the Qwen CLI credential file and must not be duplicated in auth.json where it would become stale.pool.add_entry()is retained sohermes auth listcontinues to show the entry.Test plan
test_auth_add_qwen_oauth_sets_active_providerverifiesactive_provideris set, state contains onlybase_url(noapi_key), and pool entry existstest_auth_commandstests pass