Skip to content

fix(qwen): add User-Agent to OAuth refresh request - #7782

Closed
konsisumer wants to merge 1 commit into
NousResearch:mainfrom
konsisumer:fix/qwen-oauth-refresh-user-agent
Closed

fix(qwen): add User-Agent to OAuth refresh request#7782
konsisumer wants to merge 1 commit into
NousResearch:mainfrom
konsisumer:fix/qwen-oauth-refresh-user-agent

Conversation

@konsisumer

Copy link
Copy Markdown
Contributor

Summary

Fixes #7746

  • Add a Qwen-compatible User-Agent header (QwenCode/0.14.0 (linux; x64)) to the OAuth token refresh POST request. Without this header, Qwen's endpoint may return an empty or non-JSON response, causing response.json() to fail with Expecting value: line 1 column 1.
  • Improve the qwen_refresh_invalid_json error message to include HTTP status code, Content-Type, and a body preview — making future auth failures much easier to diagnose.

Test plan

  • All 29 existing Qwen OAuth tests pass, including updated assertions that verify the User-Agent header is present and the enhanced error message includes diagnostics.

@konsisumer
konsisumer force-pushed the fix/qwen-oauth-refresh-user-agent branch 2 times, most recently from 3d746ce to d815aab Compare April 12, 2026 04:04
@konsisumer
konsisumer marked this pull request as ready for review April 12, 2026 04:36
@konsisumer
konsisumer force-pushed the fix/qwen-oauth-refresh-user-agent branch 7 times, most recently from 5a18d61 to be0470a Compare April 14, 2026 09:05
@konsisumer
konsisumer force-pushed the fix/qwen-oauth-refresh-user-agent branch from cbe5559 to 3950b44 Compare April 24, 2026 16:22
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard area/auth Authentication, OAuth, credential pools provider/qwen Qwen / Alibaba Cloud (OAuth) labels Apr 24, 2026
@konsisumer
konsisumer force-pushed the fix/qwen-oauth-refresh-user-agent branch 14 times, most recently from eedf6bb to 11d8a19 Compare April 28, 2026 07:28
@konsisumer
konsisumer force-pushed the fix/qwen-oauth-refresh-user-agent branch 11 times, most recently from 42193b8 to 4eb6581 Compare May 2, 2026 23:22
@konsisumer
konsisumer force-pushed the fix/qwen-oauth-refresh-user-agent branch from 4eb6581 to f2a6099 Compare May 3, 2026 03:28
@konsisumer

Copy link
Copy Markdown
Contributor Author

Closing — on reflection, the diff adds changes to tools/code_execution_tool.py and tests outside the Qwen OAuth scope. If this still seems valuable, please reopen with feedback on what to change.

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 P2 Medium — degraded but workaround exists 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.

[Bug]: qwen-oauth refresh fails with invalid JSON, while the same ~/.qwen/oauth_creds.json works in qwen-code-api

2 participants