Skip to content

[Bug] Windows: openclaw agent --local returns 401 Missing Authentication header after clean reset and fresh onboarding #42839

@huyouwei9583-collab

Description

@huyouwei9583-collab

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

  1. Run openclaw reset
  2. Choose Full reset
  3. Run openclaw onboard --install-daemon
  4. Select OpenRouter as the model/auth provider
  5. Paste a fresh OpenRouter API key
  6. Keep the default model as openrouter/auto
  7. Skip channel setup
  8. Skip web search
  9. Skip skills
  10. Skip hooks
  11. Start the gateway with:
    openclaw gateway --force
  12. In a separate PowerShell window, run:
    openclaw agent --local --agent main --message "请用中文做一个简短自我介绍"
  13. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingbug:behaviorIncorrect behavior without a crash

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions