Skip to content

fix(auth): set active_provider after hermes auth add qwen-oauth - #37580

Closed
AhmetArif0 wants to merge 1 commit into
NousResearch:mainfrom
AhmetArif0:fix/qwen-oauth-active-provider
Closed

fix(auth): set active_provider after hermes auth add qwen-oauth#37580
AhmetArif0 wants to merge 1 commit into
NousResearch:mainfrom
AhmetArif0:fix/qwen-oauth-active-provider

Conversation

@AhmetArif0

Copy link
Copy Markdown
Contributor

Problem

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 for qwen-oauth
(auth_type = oauth_external), the setup wizard reported "No inference
provider configured"
even after a successful login.

Root cause

Same pattern as openai-codex (#37517), xai-oauth (#37576), and
google-gemini-cli (#37579): pool.add_entry() only writes the credential-pool
entry; active_provider in auth.json is never set.

Runtime credential resolution reads tokens from the Qwen CLI credential file via
resolve_qwen_runtime_credentials() — independent of auth.json — so the agent
itself worked. Only the setup-wizard detection was broken.

Fix

Add _save_qwen_oauth_provider_state() in hermes_cli/auth.py that writes a
minimal provider-state entry (base_url, auth_file) and calls
_save_provider_state() (which sets active_provider). Call it in
auth_commands before pool.add_entry().

Test plan

  • New test test_auth_add_qwen_oauth_sets_active_provider passes
  • All 47 test_auth_commands tests pass

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 qwen-oauth,
the setup wizard reported "No inference provider configured" even after
a successful Qwen CLI OAuth login.

Add _save_qwen_oauth_provider_state() in auth.py that writes a minimal
provider-state entry (base_url, auth_file) and calls _save_provider_state()
to set active_provider. Call it in auth_commands before pool.add_entry().
Runtime credential resolution continues to use the Qwen CLI credential file
directly; auth.json is only used for provider detection.

Mirrors the fix applied to openai-codex (NousResearch#37517), xai-oauth (NousResearch#37576), and
google-gemini-cli (NousResearch#37579).
@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard area/auth Authentication, OAuth, credential pools provider/qwen Qwen / Alibaba Cloud (OAuth) P3 Low — cosmetic, nice to have labels Jun 2, 2026
@AhmetArif0 AhmetArif0 closed this Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/auth Authentication, OAuth, credential pools comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have provider/qwen Qwen / Alibaba Cloud (OAuth) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants