openclaw - 💡(How to fix) Fix [Bug]: Qwen OAuth refresh token expired or invalid - re-authentication failed since v2026.3.13 [5 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#50056Fetched 2026-04-08 00:59:45
View on GitHub
Comments
5
Participants
2
Timeline
11
Reactions
0
Timeline (top)
commented ×5closed ×2labeled ×2locked ×1

When re-authenticating the Qwen model, it shows authentication successful but the terminal still running starting Qwen OAuth.

Root Cause

When re-authenticating the Qwen model, it shows authentication successful but the terminal still running starting Qwen OAuth.

RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Summary

When re-authenticating the Qwen model, it shows authentication successful but the terminal still running starting Qwen OAuth.

Steps to reproduce

  1. Install openclaw and chose the Qwen model while installing.
  2. Use it for several hours.
  3. Token expires and auto-refresh fails.
  4. The Qwen model become unusable.
  5. Re-authenticate with the code: openclaw models auth login --provider qwenportal
  6. The authenticating webpage of qwen is opened, after re-authenticating, it shows that the authentication is successful.
  7. BUT the terminal is still running OAuth.
<img width="3072" height="1920" alt="Image" src="https://github.com/user-attachments/assets/36581da7-b76d-42d2-b628-d5c7573e2771" /> <img width="1782" height="1226" alt="Image" src="https://github.com/user-attachments/assets/252f0907-52ae-4dcd-84d3-b01d89f88991" />

Expected behavior

After the authentication, the webpage of Qwen will give a Qwen code and input the code into the terminal, the authentication will finally succeed.

Actual behavior

  • The terminal stuck at the "Starting Qwen OAuth..."

OpenClaw version

2026.3.13

Operating system

Ubuntu 24.04

Install method

No response

Model

Qwen(default)

Provider / routing chain

openclaw - > openclaw tui

Config file / key location

No response

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

Fix Plan

To resolve the issue with the Qwen model authentication, follow these steps:

  1. Update OpenClaw: Ensure you are running the latest version of OpenClaw. You can check for updates by running openclaw --version and then updating if necessary.
  2. Clear Authentication Cache: Sometimes, cached authentication tokens can cause issues. Try clearing the cache by deleting the .openclaw directory or the specific cache file related to Qwen authentication.
  3. Re-authenticate with Code: After clearing the cache, re-authenticate using the command openclaw models auth login --provider qwenportal. When prompted, enter the code provided by the Qwen authentication webpage.
  4. Check Terminal Output: After entering the code, check the terminal output for any errors or prompts that might indicate why the authentication process is not completing.

Example Code Snippets

If manual intervention is required to handle the authentication flow, you might need to modify the authentication script. Here's a basic example of how you could handle the authentication flow in a Python script using the requests library:

import requests

def authenticate_qwen():
    # Open the authentication URL
    auth_url = "https://qwenportal.com/auth"
    response = requests.get(auth_url)
    
    # Assuming the authentication code is provided in the response
    auth_code = input("Enter the authentication code: ")
    
    # Complete the authentication process
    complete_auth_url = f"https://qwenportal.com/auth/complete?code={auth_code}"
    response = requests.post(complete_auth_url)
    
    if response.status_code == 200:
        print("Authentication successful")
    else:
        print("Authentication failed")

authenticate_qwen()

Verification

To verify that the fix worked:

  • After re-authenticating, check if the terminal proceeds past the "Starting Qwen OAuth..." step.
  • Ensure that you can use the Qwen model without any authentication errors.

Extra Tips

  • Regularly update OpenClaw and its dependencies to prevent similar issues.
  • If the problem persists, consider checking the OpenClaw logs for more detailed error messages or seeking support from the OpenClaw community.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

After the authentication, the webpage of Qwen will give a Qwen code and input the code into the terminal, the authentication will finally succeed.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING