openclaw - 💡(How to fix) Fix [Bug]: agentRuntime=claude-cli silently ignored on cold-start 2026.4.26 install — dispatcher routes to openrouter/gpt-oss-120b:free with no failover log [1 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#74500Fetched 2026-04-30 06:23:29
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
2
Author
Timeline (top)
commented ×1

On a cold-start install of OpenClaw 2026.4.26, configuring agents.defaults.agentRuntime.id = "claude-cli" plus agents.defaults.cliBackends.claude-cli and an auth.profiles["anthropic:claude-cli"] OAuth profile is not honored by the dispatcher. The agent silently routes to openrouter/openai/gpt-oss-120b:free (last-resort fallback) without attempting agents.defaults.model.primary (anthropic/claude-opus-4-7) and without emitting any [model-fallback/decision] or [agent/cli-backend] events. A side-by-side host on 2026.4.24 with the identical config routes correctly through claude-cli.

Error Message

  • Severity: High — silently routes paid/private workloads to a free fallback model, defeating user's explicit provider choice and OAuth subscription. No error surfaces to operator.

Root Cause

Additional information

  • Last known good: 2026.4.24 (verified working with identical config on a different host).
  • First known bad: 2026.4.26 (this host).
  • Adjacent / possibly related:
    • #70279 — same silent-skip symptom, different root cause (systemd-root)
    • #73095 — cliBackends-only installs hit uninitialized registries on cold start
    • #73682 / #71026 — auth-profiles.json not populated for anthropic:claude-cli at runtime (closed; symptom may have regressed in .26)
    • #57326 — helper paths still bypass runCliAgent()
    • #72576 — no integration test catches the registration regression class
  • Suggested mitigations (in order of cost):
    1. Surface failover decisions in the trajectory whenever the configured agentRuntime cannot be resolved at dispatch time (currently silent — most actionable fix).
    2. Document the canonical cold-start setup flow for claude-cli as agentRuntime on .26+.
    3. Add an explicit openclaw setup-claude-cli command (or extend migrate-claude) that hydrates per-agent auth-profiles.json from ~/.claude/.credentials.json.

Fix Action

Fix / Workaround

Summary

On a cold-start install of OpenClaw 2026.4.26, configuring agents.defaults.agentRuntime.id = "claude-cli" plus agents.defaults.cliBackends.claude-cli and an auth.profiles["anthropic:claude-cli"] OAuth profile is not honored by the dispatcher. The agent silently routes to openrouter/openai/gpt-oss-120b:free (last-resort fallback) without attempting agents.defaults.model.primary (anthropic/claude-opus-4-7) and without emitting any [model-fallback/decision] or [agent/cli-backend] events. A side-by-side host on 2026.4.24 with the identical config routes correctly through claude-cli.

Actual behavior

Trajectory shows session.started directly with provider=openrouter, modelId=openai/gpt-oss-120b:free. No [model-fallback/decision] events. No [agent/cli-backend] events. The primary model anthropic/claude-opus-4-7 is never attempted. Setting agents.defaults.model.fallbacks = [] does not change behavior — dispatcher still chooses openrouter/gpt-oss-120b:free directly.

Additional provider/model setup details

  • Plugin anthropic is loaded (boot log: 3 plugins: anthropic, browser, telegram).
  • claude binary at /home/linuxbrew/.linuxbrew/bin/claude (v2.1.119), authenticated standalone via ~/.claude/.credentials.json. claude --print "hi" returns in ~4.8s.
  • Per-agent state divergence: On the broken .26 host, ~/.openclaw/agents/main/agent/auth-profiles.json does NOT contain the anthropic:claude-cli profile after cold start (despite global config defining it). On the working .24 host (silver, nvm install), the same path contains a fully-populated profile with OAuth tokens.
  • Manually injecting {provider:"claude-cli", mode:"oauth"} into the per-agent auth-profiles.json and reloading does NOT fix the routing — the dispatcher still picks gpt-oss-120b:free.
  • No imperative bootstrap command exists for this state. openclaw migrate-claude only imports Claude Desktop settings, not runtime CLI auth.

Code Example

{
     "agents.defaults.agentRuntime": { "id": "claude-cli" },
     "agents.defaults.cliBackends": {
       "claude-cli": {
         "command": "claude",
         "output": "jsonl",
         "jsonlDialect": "claude-stream-json"
       }
     },
     "agents.defaults.model.primary": "anthropic/claude-opus-4-7",
     "auth.profiles": {
       "anthropic:claude-cli": { "provider": "claude-cli", "mode": "oauth" }
     },
     "auth.order": { "anthropic": ["anthropic:claude-cli"] }
   }

---

# Working host (silver, 2026.4.24):
[reload] config change detected — agentRuntime=claude-cli registered
[agent/cli-backend] cli exec: provider=claude-cli model=claude-opus-4-7 promptChars=...

# Broken host (carbon, 2026.4.26) — same config, same Telegram input:
session.started provider=openrouter modelId=openai/gpt-oss-120b:free
(no [reload], no [model-fallback/decision], no [agent/cli-backend])
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash) — likely regression vs. 2026.4.24

Beta release blocker

No

Summary

On a cold-start install of OpenClaw 2026.4.26, configuring agents.defaults.agentRuntime.id = "claude-cli" plus agents.defaults.cliBackends.claude-cli and an auth.profiles["anthropic:claude-cli"] OAuth profile is not honored by the dispatcher. The agent silently routes to openrouter/openai/gpt-oss-120b:free (last-resort fallback) without attempting agents.defaults.model.primary (anthropic/claude-opus-4-7) and without emitting any [model-fallback/decision] or [agent/cli-backend] events. A side-by-side host on 2026.4.24 with the identical config routes correctly through claude-cli.

Steps to reproduce

  1. Cold-start install: npm install -g [email protected] on a clean host (no prior ~/.openclaw/agents/main/agent/auth-profiles.json).
  2. Install Claude Code, run claude /login, complete OAuth. Verify claude --print "hi" returns a response (~5s).
  3. Edit ~/.openclaw/openclaw.json:
    {
      "agents.defaults.agentRuntime": { "id": "claude-cli" },
      "agents.defaults.cliBackends": {
        "claude-cli": {
          "command": "claude",
          "output": "jsonl",
          "jsonlDialect": "claude-stream-json"
        }
      },
      "agents.defaults.model.primary": "anthropic/claude-opus-4-7",
      "auth.profiles": {
        "anthropic:claude-cli": { "provider": "claude-cli", "mode": "oauth" }
      },
      "auth.order": { "anthropic": ["anthropic:claude-cli"] }
    }
  4. kill -SIGUSR1 <gateway-pid> (or restart gateway).
  5. Send any Telegram message to the configured agent.

Expected behavior

Trajectory shows provider=claude-cli; logs include [agent/cli-backend] cli exec: provider=claude-cli model=.... Confirmed working on a side-by-side host running 2026.4.24 with the identical openclaw.json.

Actual behavior

Trajectory shows session.started directly with provider=openrouter, modelId=openai/gpt-oss-120b:free. No [model-fallback/decision] events. No [agent/cli-backend] events. The primary model anthropic/claude-opus-4-7 is never attempted. Setting agents.defaults.model.fallbacks = [] does not change behavior — dispatcher still chooses openrouter/gpt-oss-120b:free directly.

OpenClaw version

2026.4.26 (entrypoint /home/linuxbrew/.linuxbrew/lib/node_modules/openclaw/dist/index.js)

Operating system

Linux 6.17.0-22-generic (Ubuntu-derivative)

Install method

npm install -g openclaw under linuxbrew node

Model

Configured primary: anthropic/claude-opus-4-7 via claude-cli runtime Effective (observed): openrouter/openai/gpt-oss-120b:free

Provider / routing chain

Configured: openclaw -> claude-cli (subprocess) -> Anthropic OAuth Observed: openclaw -> openrouter -> openai/gpt-oss-120b:free (skipped primary entirely)

Additional provider/model setup details

  • Plugin anthropic is loaded (boot log: 3 plugins: anthropic, browser, telegram).
  • claude binary at /home/linuxbrew/.linuxbrew/bin/claude (v2.1.119), authenticated standalone via ~/.claude/.credentials.json. claude --print "hi" returns in ~4.8s.
  • Per-agent state divergence: On the broken .26 host, ~/.openclaw/agents/main/agent/auth-profiles.json does NOT contain the anthropic:claude-cli profile after cold start (despite global config defining it). On the working .24 host (silver, nvm install), the same path contains a fully-populated profile with OAuth tokens.
  • Manually injecting {provider:"claude-cli", mode:"oauth"} into the per-agent auth-profiles.json and reloading does NOT fix the routing — the dispatcher still picks gpt-oss-120b:free.
  • No imperative bootstrap command exists for this state. openclaw migrate-claude only imports Claude Desktop settings, not runtime CLI auth.

Logs, screenshots, and evidence

# Working host (silver, 2026.4.24):
[reload] config change detected — agentRuntime=claude-cli registered
[agent/cli-backend] cli exec: provider=claude-cli model=claude-opus-4-7 promptChars=...

# Broken host (carbon, 2026.4.26) — same config, same Telegram input:
session.started provider=openrouter modelId=openai/gpt-oss-120b:free
(no [reload], no [model-fallback/decision], no [agent/cli-backend])

Impact and severity

  • Affected: Operators upgrading to 2026.4.26 who configure claude-cli runtime via documented config keys. Likely 100% of cold-start installs on .26 (reproduced 1/1 on this host; 0/1 on .24 side-by-side).
  • Severity: High — silently routes paid/private workloads to a free fallback model, defeating user's explicit provider choice and OAuth subscription. No error surfaces to operator.
  • Frequency: Always (every turn, every channel).
  • Consequence: Wrong model serving responses; subscription unused; no diagnostic trail to recover from.

Additional information

  • Last known good: 2026.4.24 (verified working with identical config on a different host).
  • First known bad: 2026.4.26 (this host).
  • Adjacent / possibly related:
    • #70279 — same silent-skip symptom, different root cause (systemd-root)
    • #73095 — cliBackends-only installs hit uninitialized registries on cold start
    • #73682 / #71026 — auth-profiles.json not populated for anthropic:claude-cli at runtime (closed; symptom may have regressed in .26)
    • #57326 — helper paths still bypass runCliAgent()
    • #72576 — no integration test catches the registration regression class
  • Suggested mitigations (in order of cost):
    1. Surface failover decisions in the trajectory whenever the configured agentRuntime cannot be resolved at dispatch time (currently silent — most actionable fix).
    2. Document the canonical cold-start setup flow for claude-cli as agentRuntime on .26+.
    3. Add an explicit openclaw setup-claude-cli command (or extend migrate-claude) that hydrates per-agent auth-profiles.json from ~/.claude/.credentials.json.

extent analysis

TL;DR

The most likely fix is to modify the authentication profile handling to ensure that the anthropic:claude-cli profile is properly populated and recognized by the dispatcher in OpenClaw version 2026.4.26.

Guidance

  1. Verify authentication profile population: Check if the anthropic:claude-cli profile is correctly populated in ~/.openclaw/agents/main/agent/auth-profiles.json after a cold start.
  2. Investigate dispatcher logic: Examine the dispatcher's decision-making process to understand why it silently skips the configured claude-cli runtime and falls back to openrouter/openai/gpt-oss-120b:free.
  3. Test with explicit setup command: Consider adding an explicit openclaw setup-claude-cli command to hydrate the per-agent auth-profiles.json from ~/.claude/.credentials.json and test if this resolves the issue.
  4. Review adjacent issues: Look into related issues like #70279, #73095, #73682, #57326, and #72576 to see if they provide any insights or potential fixes for the current problem.

Example

No specific code snippet is provided due to the complexity of the issue and the need for a more in-depth investigation.

Notes

The problem seems to be related to the authentication profile handling and the dispatcher's decision-making process in OpenClaw version 2026.4.26. The fact that the issue does not occur in version 2026.4.24 suggests a regression.

Recommendation

Apply a workaround by manually populating the anthropic:claude-cli profile in ~/.openclaw/agents/main/agent/auth-profiles.json and restarting the gateway to see if this resolves the issue, as the root cause is likely related to authentication profile handling.

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

Trajectory shows provider=claude-cli; logs include [agent/cli-backend] cli exec: provider=claude-cli model=.... Confirmed working on a side-by-side host running 2026.4.24 with the identical openclaw.json.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: agentRuntime=claude-cli silently ignored on cold-start 2026.4.26 install — dispatcher routes to openrouter/gpt-oss-120b:free with no failover log [1 comments, 2 participants]