Skip to content

[Bug]: claude-opus-4-7 rejected as "Unknown model" on 2026.4.15 despite being in codebase and accepted by Anthropic API #68241

Description

@alfredneuworth

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

After upgrading from OpenClaw 2026.4.2 to 2026.4.15, configuring anthropic/claude-opus-4-7 as agent primary model causes FailoverError: Unknown model on every request. The model falls back to claude-opus-4-6. The model string claude-opus-4-7 exists in the 2026.4.15 codebase as ANTHROPIC_OPUS_47_MODEL_ID and DEFAULT_ANTHROPIC_MODEL, and is accepted by the Anthropic API directly (HTTP 200 via curl).

Steps to reproduce

  1. Upgrade OpenClaw: npm update -g openclaw (2026.4.2 -> 2026.4.15)
  2. Set agents.defaults.model.primary to anthropic/claude-opus-4-7 in openclaw.json
  3. Restart gateway: systemctl --user restart openclaw-gateway
  4. Observe gateway log: journalctl --user -u openclaw-gateway | grep opus-4-7
  5. Delete ~/.openclaw/agents/main/agent/models.json to force cache regen
  6. Restart gateway again
  7. Same error persists

Expected behavior

Gateway should accept anthropic/claude-opus-4-7 and route requests to the Anthropic API. The Anthropic API accepts this model string (verified: curl -X POST https://api.anthropic.com/v1/messages -d '{"model":"claude-opus-4-7",...}' returns HTTP 200). claude-opus-4-6 works on the same gateway config.

Actual behavior

Gateway startup: [gateway] startup model warmup failed for anthropic/claude-opus-4-7: Error: Unknown model: anthropic/claude-opus-4-7. Every agent request falls back to opus-4-6 via the fallback chain. Per-agent models.json cache regenerates without an anthropic provider entry (only openai-codex, codex, ollama). The Anthropic plugin shows as "loaded" in openclaw plugins list but does not appear in the gateway's active plugin count at boot ("6 plugins: acpx, browser, device-pair, phone-control, talk-voice, telegram").

OpenClaw version

2026.4.15 (041266a)

Operating system

Ubuntu 24.04 / WSL2 on Windows 11 Pro

Install method

npm global

Model

anthropic/claude-opus-4-7

Provider / routing chain

openclaw gateway -> anthropic API (direct, no proxy)

Additional provider/model setup details

Auth profile in ~/.openclaw/agents/main/agent/auth-profiles.json has anthropic:default with valid API key (opus-4-6 works). No disabledUntil, no usageStats, no cooldowns. WSL2 with NODE_OPTIONS=--dns-result-order=ipv4first in systemd override. Gateway bound to loopback only.

Logs, screenshots, and evidence

Gateway startup log:

[gateway] agent model: anthropic/claude-opus-4-7
[gateway] ready (6 plugins: acpx, browser, device-pair, phone-control, talk-voice, telegram; 7.4s)
[gateway] startup model warmup failed for anthropic/claude-opus-4-7: Error: Unknown model: anthropic/claude-opus-4-7


Model string in 2026.4.15 source:

const ANTHROPIC_OPUS_47_MODEL_ID = "claude-opus-4-7";
const DEFAULT_ANTHROPIC_MODEL = "anthropic/claude-opus-4-7";


Curl verification:

curl -X POST https://api.anthropic.com/v1/messages -H "anthropic-version: 2023-06-01" -d '{"model":"claude-opus-4-7","max_tokens":10,"messages":[{"role":"user","content":"hi"}]}'
HTTP 200 — "model":"claude-opus-4-7"


Per-agent models.json after cache regen:

Providers: [ 'openai-codex', 'codex', 'ollama' ]
// No anthropic provider entry

Impact and severity

Affected: Any user configuring claude-opus-4-7 as primary model on 2026.4.15
Severity: Medium (blocks new model adoption, workaround exists via opus-4-6 fallback)
Frequency: 100% reproducible — every request to opus-4-7 fails
Consequence: Forces fallback to opus-4-6 on every request, preventing use of the newer model. Extra latency from the fallback chain (~1s per request).

Additional information

Suspected root cause: The per-agent models.json cache file regenerates without an anthropic provider block. Only openai-codex, codex, and ollama appear. The gateway resolves opus-4-6 through what appears to be a legacy/hardcoded path (works without being in models.json), but opus-4-7 requires the provider to be registered in the cache. The Anthropic plugin shows "loaded" in openclaw plugins list but something in the provider auto-registration sequence fails to populate the anthropic entry.

Workaround: Revert to anthropic/claude-opus-4-6 as primary model.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingregressionBehavior that previously worked and now fails

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions