fix(qwen): update auth guidance for Qwen CLI 0.19.x removal of qwen auth - #66872
fix(qwen): update auth guidance for Qwen CLI 0.19.x removal of qwen auth#66872mudrii wants to merge 1 commit into
qwen auth#66872Conversation
…auth` The Qwen CLI removed the `qwen auth` subcommand in 0.19.x — installed `qwen --help` now reports `qwen auth Configure authentication (removed)`. The supported replacement is to run `qwen` interactively and use the `/auth` slash command, or to edit ~/.qwen/oauth_creds.json / ~/.qwen/settings.json manually. Cached OAuth tokens at ~/.qwen/oauth_creds.json still work for existing sessions; the change is only in the *setup* surface. Hermes still reads ~/.qwen/oauth_creds.json for the `qwen-oauth` provider, so the OAuth token protocol is unchanged. Only the user-facing guidance strings that previously pointed at the removed `qwen auth qwen-oauth` command are updated to point at `qwen` + `/auth` and manual config edits. Updated guidance surfaces: - hermes_cli/auth.py — four AuthError messages (qwen_auth_missing, qwen_refresh_token_missing, qwen_refresh_failed, qwen_access_token_missing). - hermes_cli/model_setup_flows.py — _model_flow_qwen_oauth() login prompt. - hermes_cli/status.py — `hermes status` Qwen OAuth row. - agent/credential_sources.py — _remove_qwen_cli() suppression hints. - agent/credential_pool.py — comment on ~/.qwen/oauth_creds.json source. Tests: - Updated two existing tests (refresh-status error path, model-flow reauth prompt) to assert against the new wording and forbid the removed `qwen auth qwen-oauth` literal. - Added seven new focused tests pinning the new guidance strings across all four AuthError codes, the model-flow not-logged-in path, the status row, and the credential-suppression hints. - Verified the literal old guidance strings no longer appear anywhere in hermes_cli/* via test_status_command_qwen_row_uses_slash_auth_guidance. Refs: - Qwen CLI docs: 'Removed qwen auth CLI command' https://qwenlm.github.io/qwen-code-docs/en/users/configuration/auth/ Unrelated PRs (left untouched as instructed): - NousResearch#63101 fix(gateway): clear stale status for disabled platforms - NousResearch#64203 fix(doctor): recognize configured MoA orchestration
There was a problem hiding this comment.
Pull request overview
Updates Hermes’ Qwen OAuth user guidance to reflect Qwen CLI 0.19.x removing the qwen auth subcommand, ensuring re-auth instructions point to the supported interactive /auth flow (or manual credential-file edits) across CLI surfaces and credential handling.
Changes:
- Update Qwen OAuth error/help strings and status output to reference
qwen+/auth(and relevant~/.qwen/*.jsonfiles) instead ofqwen auth qwen-oauth. - Adjust Qwen OAuth model setup flow messaging to match the new supported re-auth path.
- Expand and update tests to pin the new guidance and prevent regressions to the removed subcommand.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
hermes_cli/auth.py |
Updates Qwen OAuth AuthError guidance strings to the new qwen + /auth re-auth flow and manual file-edit options. |
hermes_cli/model_setup_flows.py |
Updates the qwen-oauth model setup prompt text for “not logged in” to the new guidance. |
hermes_cli/status.py |
Updates hermes status Qwen OAuth row text to mention qwen + /auth and the 0.19.x removal. |
agent/credential_sources.py |
Updates suppression/removal hints for qwen-cli sourced credentials to point at the supported replacement auth path. |
agent/credential_pool.py |
Updates inline comments to reflect the new Qwen CLI authentication workflow. |
tests/hermes_cli/test_auth_qwen_provider.py |
Updates existing assertions and adds focused tests to pin new wording and ensure removed guidance doesn’t reappear. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # No credentials file → not logged in. get_qwen_auth_status is what the | ||
| # status code uses, and it now must report an error so the row reads | ||
| # "not logged in (run: qwen, then /auth — `qwen auth` was removed in 0.19.x)". | ||
| qwen_status = get_qwen_auth_status() | ||
| assert qwen_status.get("logged_in") is False | ||
|
|
||
| # Reproduce the literal format used in hermes_cli/status.py:282 so a | ||
| # future refactor that breaks the wording fails this test. | ||
| expected = ( | ||
| "not logged in (run: qwen, then /auth — `qwen auth` was removed in 0.19.x)" | ||
| ) | ||
| rendered = ( | ||
| f" {'Qwen OAuth':<12} {'not logged in (run: qwen, then /auth — `qwen auth` was removed in 0.19.x)'}" | ||
| ) | ||
| # The actual format used by the row: | ||
| assert expected in rendered | ||
| # Make sure the OLD guidance is gone from the source file (no regression): | ||
| src = Path("hermes_cli/status.py").read_text(encoding="utf-8") | ||
| assert "run: qwen auth qwen-oauth" not in src | ||
| # And the NEW guidance is present: | ||
| assert "run: qwen, then /auth" in src |
| return RemovalResult(hints=[ | ||
| "Suppressed qwen-cli credential — it will not be re-seeded.", | ||
| "Note: Qwen CLI credentials still live in ~/.qwen/oauth_creds.json", | ||
| "Run `hermes auth add qwen-oauth` to re-enable if needed.", | ||
| # The `qwen auth` CLI subcommand was removed in Qwen CLI 0.19.x. | ||
| "Run `qwen` interactively and use `/auth` to re-enable, or edit", | ||
| "~/.qwen/oauth_creds.json / ~/.qwen/settings.json manually.", |
Related: #46851 implements the separate modern-Qwen |
|
Thanks for tracing the obsolete Qwen CLI command across the user-facing paths. The stale guidance is present on current main, but this needs a correction before salvage. Problems
Suggested changes
Automated hermes-sweeper review. |
SummaryFive PRs are associated with this Qwen authentication complex. #7751 and #7782 add User-Agent headers and diagnostics to the legacy OAuth refresh path, #28244 addresses its redirect-driven empty-body failure, #46851 adds modern settings.json credential discovery, and #66872 updates guidance for the removed qwen auth command. Related pull requests
Duplicates#7751 and #7782 are substantially duplicate User-Agent-plus-diagnostics attempts for the legacy refresh failure; #28244 uses the distinct causal redirect fix. #46851 and #66872 overlap in modern-Qwen guidance but are not duplicates because #46851 adds credential loading while #66872 changes user-facing instructions. Suggested consolidationAuthor action: rebase #46851 onto main, or split out the part that can merge, preserving settings.json discovery while routing selectedType=openai/DASHSCOPE_API_KEY through the correct DashScope/OpenAI-compatible path and suppressing OAuth refresh even with force_refresh=True. Keep #66872 open with a salvage path limited to accurate removed-command guidance, restoration of hermes auth add qwen-oauth for unsuppression, deferral of unsupported settings.json claims, and direct show_status() coverage; keep #28244 open separately for #7746 after isolating follow_redirects=True and adding focused tests, while #7751 and #7782 remain closed as overlapping superseded attempts. Complex graphflowchart LR
classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
classDef best stroke-width:3px,stroke:#b45309
classDef target stroke-width:3px,stroke:#4338ca
I46771(["issue #46771 (open)"])
P66872["PR #66872 (open)"]
P66872 -.->|partial| I46771
class I46771 open
class P66872 open
class P66872 target
click I46771 "https://github.com/NousResearch/hermes-agent/issues/46771"
click P66872 "https://github.com/NousResearch/hermes-agent/pull/66872"
Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label). Cross-PR triage: Reviewed 5 pull requests and 2 issues in this complex. Each diff was read against this issue; Assessment working set: 62 kB of PR diffs, 20 kB of issue/PR text, 8 kB of discussion (11 comments), 7 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
Summary
The
qwen authCLI subcommand was removed in Qwen CLI 0.19.x. Installedqwen --helpnow reportsqwen auth Configure authentication (removed).Hermes was still telling users to run
qwen auth qwen-oauthin fiveplaces — every one of those messages now points users at the supported
replacement (
qweninteractively +/auth, or manual editing of~/.qwen/oauth_creds.json/~/.qwen/settings.json).The OAuth token protocol is unchanged: cached tokens at
~/.qwen/oauth_creds.jsonstill work for existing sessions. Only thesetup surface moved.
Why
qwen --help(installed 0.19.11) shows:…and the upstream docs confirm:
Source: https://qwenlm.github.io/qwen-code-docs/en/users/configuration/auth/
Hermes still reads
~/.qwen/oauth_creds.jsonfor theqwen-oauthprovider, so users who already logged in keep working. The fix is only
about not breaking their next re-auth attempt.
Changes
hermes_cli/auth.pyAuthErrormessages:qwen_auth_missing,qwen_refresh_token_missing,qwen_refresh_failed,qwen_access_token_missingnow mention0.19.xand point atqwen+/auth(and manualoauth_creds.jsonediting).hermes_cli/model_setup_flows.py_model_flow_qwen_oauth()not-logged-in prompt now printsRun: qwen (then use /auth to re-authenticate)+ manual-file hint.hermes_cli/status.pyhermes statusQwen OAuth row now readsnot logged in (run: qwen, then /auth —qwen authwas removed in 0.19.x).agent/credential_sources.py_remove_qwen_cli()suppression hints replacedRunhermes auth add qwen-oauthwith `Run `qwen` interactively and use `/auth`, or edit `~/.qwen/oauth_creds.json` / `~/.qwen/settings.json.agent/credential_pool.pytests/hermes_cli/test_auth_qwen_provider.pyTests
New tests (one per affected surface):
test_missing_credentials_message_points_at_qwen_and_slash_auth—qwen_auth_missingAuthErrortest_refresh_token_missing_message_points_at_qwen_and_slash_auth—qwen_refresh_token_missingAuthErrortest_refresh_failed_message_mentions_removed_subcommand_and_replacement—qwen_refresh_failedAuthError + 4xx body propagationtest_access_token_missing_message_points_at_qwen_and_slash_auth—qwen_access_token_missingAuthErrortest_model_flow_qwen_oauth_not_logged_in_guidance—_model_flow_qwen_oauthnot-logged-in stdouttest_status_command_qwen_row_uses_slash_auth_guidance—hermes statusrow literal + source-grep regression guardtest_qwen_cli_remove_hints_use_supported_replacement—_remove_qwen_clihintsEach test explicitly asserts both that the new guidance is present
(
0.19.x,/auth,Run: qwen) and that the removed guidance(
qwen auth qwen-oauth) is not present — so a future regressionthat re-introduces the removed subcommand fails immediately.
Broader sanity (unchanged areas, must stay green):
Unrelated PRs left untouched
Per task instructions, I noted these existing open PRs but did not
close or merge them — they're orthogonal to Qwen OAuth guidance:
fix(gateway): clear stale status for disabled platforms on startup(mergeable)fix(doctor): recognize configured MoA orchestration(duplicate of local MoA work, can be closed separately if desired)Checklist
mudrii:fix/qwen-oauth-guidance.qwen auth qwen-oauthliteral.