-
-
Notifications
You must be signed in to change notification settings - Fork 69.5k
[Bug] Windows: openclaw agent --local returns 401 Missing Authentication header after clean reset and fresh onboarding #42839
Description
Bug type
Behavior bug (incorrect output/state without crash)
Summary
On Windows 11, openclaw agent --local --agent main consistently fails with 401 Missing Authentication header even after a full reset, fresh onboarding, new OpenRouter API key, and a running local gateway.
Steps to reproduce
- Run
openclaw reset - Choose
Full reset - Run
openclaw onboard --install-daemon - Select
OpenRouteras the model/auth provider - Paste a fresh OpenRouter API key
- Keep the default model as
openrouter/auto - Skip channel setup
- Skip web search
- Skip skills
- Skip hooks
- Start the gateway with:
openclaw gateway --force - In a separate PowerShell window, run:
openclaw agent --local --agent main --message "请用中文做一个简短自我介绍" - Observe the result:
401 Missing Authentication header
Expected behavior
The agent should successfully call the configured OpenRouter model and return a normal text reply in the terminal.
Actual behavior
The command fails every time with:
401 Missing Authentication header
Terminal output also shows:
[agent/embedded] embedded run agent end ... isError=true error=401 Missing Authentication header
This still happens after a full reset, fresh onboarding, and a newly generated OpenRouter API key.
OpenClaw version
2026.3.8
Operating system
Windows 11
Install method
npm global
Model
openrouter/auto
Provider / routing chain
openclaw -> openrouter
Config file / key location
~/.openclaw/openclaw.json ~/.openclaw/agents/main/agent/auth-profiles.json
Additional provider/model setup details
Fresh setup after full reset.
Provider selected during onboarding:
- OpenRouter
Default model:
- openrouter/auto
Relevant config/auth locations:
- ~/.openclaw/openclaw.json
- ~/.openclaw/agents/main/agent/auth-profiles.json
A fresh OpenRouter API key was generated and pasted during onboarding.
No web search, skills, hooks, or channels were configured.
Logs, screenshots, and evidence
Attached screenshots show:
1. `openclaw doctor`
2. `openclaw gateway --force` successfully starting and listening on `ws://127.0.0.1:18789`
3. `openclaw agent --local --agent main --message "请用中文做一个简短自我介绍"` failing with:
`401 Missing Authentication header`
Key terminal line:
`[agent/embedded] embedded run agent end ... isError=true error=401 Missing Authentication header`Impact and severity
Affected: Windows local CLI usage
Severity: High (blocks basic local agent usage)
Frequency: 100% reproducible
Consequence: The agent cannot return any reply through openclaw agent --local, even after a clean reset and fresh onboarding
Additional information
I do not know whether this is a regression because I do not have a confirmed older working version on this machine.
What I already tried:
- Full reset
- Fresh onboarding
- Newly generated OpenRouter API key
- Restarting gateway with
openclaw gateway --force
The issue persists in the same way every time.