fix(auth): set active_provider after hermes auth add qwen-oauth - #39011
Merged
Conversation
Contributor
🔎 Lint report:
|
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 (#37517) and xai-oauth (#37576).
teknium1
force-pushed
the
hermes/hermes-f8da4407
branch
from
June 4, 2026 12:46
6d33396 to
033f6e7
Compare
2 tasks
Open
19 tasks
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
hermes auth add qwen-oauthnow setsactive_providerin auth.json, so the setup wizard and status commands detect the provider after a Qwen OAuth login.Root cause: the qwen-oauth branch of
auth_add_commandcalledpool.add_entry()but never wroteactive_provider, so the setup wizard reported "No inference provider configured" even after a successful login. Same pattern fixed foropenai-codexin #37517.Changes
hermes_cli/auth.py: new_mark_qwen_oauth_active()— writes a minimal provider-state entry (base_urlonly) and calls_save_provider_state()to setactive_provider. Deliberately does NOT copy theapi_key; Qwen OAuth tokens live in the Qwen CLI credential file read byresolve_qwen_runtime_credentials(), so storing them in auth.json would just create a stale duplicate.hermes_cli/auth_commands.py: call_mark_qwen_oauth_active(creds)in the qwen-oauth path.pool.add_entry()retained sohermes auth liststill shows the entry.test_auth_add_qwen_oauth_sets_active_provider.Validation
active_providerafterauth add qwen-oauthNoneqwen-oauthapi_keyin providers statehermes auth listtest_auth_commandspass.auth_add_command):active_providergoes None →qwen-oauth, state containsbase_urlonly, no token leak into the providers block, pool entry preserved,get_active_provider()resolves correctly.Salvages #37602 by @AhmetArif0 (cherry-picked onto current main, authorship preserved).
Infographic