openclaw - ✅(Solved) Fix openclaw configure --section model leaves stale claude-cli/ prefix in model config [1 pull requests, 1 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#57907Fetched 2026-04-08 01:56:14
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
cross-referenced ×1subscribed ×1

Fix Action

Workaround

openclaw config set agents.defaults.model.primary "anthropic/claude-opus-4-6"
openclaw config set agents.defaults.model.fallbacks '["anthropic/claude-sonnet-4-6", "openai-codex/gpt-5.4"]'

PR fix notes

PR #58386: fix: emit cli-backends.runtime as standalone build entry

Description (problem / solution / changelog)

Fixes #57326

What's broken

The claude-cli provider (and all CLI backend providers) fails with "Unknown model" errors on every request:

⚠️ Agent failed before reply: All models failed (5):
  claude-cli/claude-sonnet-4-6: Unknown model (model_not_found)
  claude-cli/claude-opus-4-6: Unknown model (model_not_found)
  ...

This affects anyone who configured the Anthropic Claude CLI auth method via openclaw agents add or openclaw configure --section model.

How to reproduce

  1. openclaw agents add main → Anthropic → "Anthropic Claude CLI"
  2. Send any message via TUI, Telegram, Slack, or openclaw agent
  3. Every request fails with Unknown model: claude-cli/...

Root cause

Two independent issues prevent claude-cli from working:

1. CLI backend routing (commit 1): The CLI backends runtime module is not emitted as a standalone file by the bundler — it gets inlined into another chunk. At runtime, isCliProvider() silently fails to load the module and always returns false, so claude-cli requests are sent to the embedded inference runner instead of the CLI runner subprocess.

2. Provider hook resolution (commit 2): Even when the model resolver runs for claude-cli, the plugin ownership lookup and provider runtime hooks don't fire because claude-cli is only registered as a cliBackend, not as a provider or hookAlias on the Anthropic plugin. This was independently diagnosed in #57326 (comment).

Fix

Commit 1 — fix CLI backend routing:

  • Register the CLI backends runtime as a standalone build entry (matching how provider-runtime.runtime is already registered)
  • Fix the require() resolution pattern to anchor to the correct file location
  • Add a build-smoke assertion to prevent silent regression

Commit 2 — fix provider hook resolution (credit: #57326 comment):

  • Add claude-cli as a hookAlias on the Anthropic provider so matchesProviderId() and runtime hooks fire
  • Include cliBackends in resolveOwningPluginIdsForProvider() so the plugin registry maps CLI backend IDs back to their owning plugin

May also partially address #57907.

Changed files

  • extensions/anthropic/index.ts (modified, +2/-0)
  • scripts/test-built-plugin-singleton.mjs (modified, +8/-0)
  • src/agents/model-selection.ts (modified, +8/-1)
  • src/plugins/providers.ts (modified, +8/-2)
  • tsdown.config.ts (modified, +1/-0)

Code Example

openclaw config set agents.defaults.model.primary "anthropic/claude-opus-4-6"
openclaw config set agents.defaults.model.fallbacks '["anthropic/claude-sonnet-4-6", "openai-codex/gpt-5.4"]'
RAW_BUFFERClick to expand / collapse

Problem

Running openclaw configure --section model and choosing 'Anthropic Claude CLI' sets the model to claude-cli/claude-opus-4-6 which is not a valid model ID. This results in Unknown model: claude-cli/claude-opus-4-6 (model_not_found) errors.

The fallback models also get set with the claude-cli/ prefix, so both primary and fallback fail.

Expected behavior

The configure wizard should always produce valid model IDs using the anthropic/ prefix.

Workaround

openclaw config set agents.defaults.model.primary "anthropic/claude-opus-4-6"
openclaw config set agents.defaults.model.fallbacks '["anthropic/claude-sonnet-4-6", "openai-codex/gpt-5.4"]'

Environment

  • OpenClaw 2026.3.28
  • macOS (arm64)

extent analysis

Fix Plan

The fix involves updating the model IDs to use the correct anthropic/ prefix.

Code Changes

To resolve this issue, update the openclaw configure script to use the correct model IDs. Specifically, replace claude-cli/ with anthropic/ for both primary and fallback models.

# In the openclaw configure script, update the model IDs
primary_model_id = "anthropic/claude-opus-4-6"
fallback_model_ids = ["anthropic/claude-sonnet-4-6", "openai-codex/gpt-5.4"]

Configuration Changes

Alternatively, you can manually update the configuration using the following commands:

openclaw config set agents.defaults.model.primary "anthropic/claude-opus-4-6"
openclaw config set agents.defaults.model.fallbacks '["anthropic/claude-sonnet-4-6", "openai-codex/gpt-5.4"]'

Verification

After applying the fix, run openclaw configure --section model and verify that the model IDs are correctly set with the anthropic/ prefix. You can also check the configuration using openclaw config get agents.defaults.model.primary and openclaw config get agents.defaults.model.fallbacks.

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

The configure wizard should always produce valid model IDs using the anthropic/ prefix.

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 - ✅(Solved) Fix openclaw configure --section model leaves stale claude-cli/ prefix in model config [1 pull requests, 1 participants]