fix: openclaw setup defaults to a retired model - #249
Conversation
Running the OpenClaw installer without --model wrote a provider entry pointing at claude-sonnet-4-20250514, which Anthropic retired on 15 June 2026. Anyone who set up OpenClaw through us since then landed on a model that answers every request with a 404, and the failure only shows up at first prompt rather than during setup. Both the DEFAULT_MODEL constant and the fallback in the provider block now use claude-sonnet-4-6, Anthropic's recommended replacement, which is confirmed serving live traffic through the gateway today. Pairs with websentry-ai/docs#113, which fixes the matching default recorded on the OpenClaw integration page. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
vigneshsubbiah16
left a comment
There was a problem hiding this comment.
Failed to authenticate: OAuth session expired and could not be refreshed
🤖 consensus review · reviewers: Cursor,Claude,Semgrep,Gitleaks · head 39f3a14d · 2026-08-20T08:00Z
Changing the default only helped fresh installs. Re-running setup without --model deliberately preserves an existing model choice, so every machine configured by the old installer kept claude-sonnet-4-20250514 in both the provider model list and agents.defaults.model.primary, and kept 404ing. Re-runs now rewrite a stored model id only when Anthropic has retired it. A deliberate non-retired choice is still preserved, and an explicit --model still wins over both. | Stored model on re-run | Before | After | |---|---|---| | claude-sonnet-4-20250514 | kept, still 404s | claude-sonnet-4-6 | | gpt-4o | kept | kept | | any, with --model passed | overwritten | overwritten | Verified against a temporary HOME with an old-installer config: retired ids migrate in both places, a gpt-4o choice survives untouched, --model overrides either way, and apiKey and the rest of the provider block are left alone. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
vigneshsubbiah16
left a comment
There was a problem hiding this comment.
Failed to authenticate: OAuth session expired and could not be refreshed
🤖 consensus review · reviewers: Cursor,Claude,Semgrep,Gitleaks · head ed4d7341 · 2026-08-20T09:10Z
Comment-disposition audit — head
|
| # | Finding | Disposition |
|---|---|---|
| 1 | P1 — Existing defaults remain retired. "When a user configured by the old installer reruns setup without --model, the existing-provider branches update only baseUrl and preserve both the provider model list and agents.defaults.model.primary, causing the next prompt to continue using claude-sonnet-4-20250514 and return a retired-model 404." |
✅ Fixed in ed4d734. Correct and material — the original change only helped fresh installs, and every already-configured machine would have stayed broken. Re-runs now rewrite a stored model id only when Anthropic has retired it, via a RETIRED_MODEL_REPLACEMENTS map applied to both the provider model list and agents.defaults.model.primary. |
Greptile on the new head: 1 file reviewed, 0 comments added. The P1 thread is marked resolved.
Why the fix is narrow rather than "always overwrite": preserving a deliberate model choice on re-run is intentional behaviour worth keeping. Only known-retired ids are rewritten.
| Stored model on re-run | Before | After |
|---|---|---|
claude-sonnet-4-20250514 |
kept, still 404s | claude-sonnet-4-6 |
gpt-4o |
kept | kept |
any, with --model passed |
overwritten | overwritten |
Verified against a temporary HOME holding an old-installer config — all four cases pass: retired ids migrate in both places, a gpt-4o choice survives untouched, --model still overrides either way, and apiKey plus the rest of the provider block are left alone.
Other reviewers
| Reviewer | Findings | Disposition |
|---|---|---|
| Cursor Bugbot | "no issues found" | Nothing to dispose of |
| Cursor Security Agent | Run completed, no findings posted | Nothing to dispose of |
| Consensus / Vignesh security review | 39f3a14d and ed4d7341 |
Unresolved. See below |
CI on ed4d7341
| Check | Result |
|---|---|
| static-checks | pass (9s) |
| Cursor Bugbot | pass (2m21s) |
| Cursor Security Agent | pass (2m20s) |
| Greptile Review | pass (1m57s) |
Diff review
- Additive/destructive: the second commit is purely additive — one constant, two module-level helpers, and two
elsebranches that previously only printed a message. No existing branch was removed and no signature changed;--modeland fresh-install behaviour are byte-identical to before. - Code comments: one line,
# Anthropic has retired these, so a config still naming one 404s on every prompt.— states the rule, not the review history. Two one-line docstrings on the new helpers. No PR numbers, ticket ids, or SHAs in code. - Over-engineering: the map holds only ids Anthropic has actually retired, and the helpers are the smallest form that covers both places a model id is stored. No config framework, no version detection.
The one open item
The consensus review has never run on this PR — it posted an auth failure rather than a verdict, on both commits. That is not the same as "no findings", so this does not clear a strict merge gate until the bot's OAuth session is refreshed. The same failure appears on websentry-ai/ai-gateway-data#2674, so it is a bot-wide problem rather than anything about this change.
🤖 Generated with Claude Code
Running the OpenClaw installer without
--modelwrote a provider entry pointing atclaude-sonnet-4-20250514. Anthropic retired that model on 15 June 2026, so every install since then has been configured against a model that answers with a 404.The failure mode is unkind: setup completes successfully and reports success, then the first actual prompt fails.
DEFAULT_MODELunbound/claude-sonnet-4-20250514unbound/claude-sonnet-4-6claude-sonnet-4-20250514claude-sonnet-4-6claude-sonnet-4-6is Anthropic's recommended replacement for Sonnet 4, and it is confirmed serving live traffic through the prod gateway today, so it is in the catalog and bookable.Pairs with
websentry-ai/docs#113 — the OpenClaw integration page documented this same default (
--model MODEL_ID | Use a custom model (default: claude-sonnet-4-20250514)) and is updated to match.Verify
--model.claude-sonnet-4-6.🤖 Generated with Claude Code
Note
Low Risk
Installer-only configuration changes with no auth or data-path impact; risk is limited to picking the wrong replacement model for edge-case custom configs.
Overview
Fixes OpenClaw setup pointing at Anthropic-retired models by changing fresh-install defaults from
claude-sonnet-4-20250514toclaude-sonnet-4-6(includingDEFAULT_MODELand the provider fallback when--modelis omitted).Adds automatic migration on reruns for existing
~/.openclaw/openclaw.jsonconfigs: aRETIRED_MODEL_REPLACEMENTSmap plus helpers rewrite retired model IDs in the Unbound provider’smodelslist and upgradeagents.defaults.model.primarywhen it still references a retired id (provider prefix preserved).Users who only had a stale
baseUrlupdate path are unchanged; reruns without--modelnow repair retired Sonnet/Opus/Haiku entries instead of leaving 404-prone model names in place.Reviewed by Cursor Bugbot for commit ed4d734. Bugbot is set up for automated code reviews on this repo. Configure here.
Greptile Summary
The installer now defaults new OpenClaw configurations to an active Claude Sonnet model and repairs retired model identifiers when setup is rerun.
claude-sonnet-4-6.Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains; the current rerun path updates retired provider entries and the existing retired primary model.
Important Files Changed
Reviews (2): Last reviewed commit: "fix: migrate existing openclaw installs ..." | Re-trigger Greptile
Context used: