Skip to content

fix: openclaw setup defaults to a retired model - #249

Merged
AakashVelusamy merged 2 commits into
stagingfrom
fix/openclaw-setup-defaults-to-a-retired-model
Aug 20, 2026
Merged

fix: openclaw setup defaults to a retired model#249
AakashVelusamy merged 2 commits into
stagingfrom
fix/openclaw-setup-defaults-to-a-retired-model

Conversation

@AakashVelusamy

@AakashVelusamy AakashVelusamy commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Running the OpenClaw installer without --model wrote a provider entry pointing at claude-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.

Before After
DEFAULT_MODEL unbound/claude-sonnet-4-20250514 unbound/claude-sonnet-4-6
Provider block fallback claude-sonnet-4-20250514 claude-sonnet-4-6

claude-sonnet-4-6 is 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

  1. Run the installer with no --model.
  2. The written provider entry should read claude-sonnet-4-6.
  3. A first prompt through OpenClaw returns a completion rather than a 404.

🤖 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-20250514 to claude-sonnet-4-6 (including DEFAULT_MODEL and the provider fallback when --model is omitted).

Adds automatic migration on reruns for existing ~/.openclaw/openclaw.json configs: a RETIRED_MODEL_REPLACEMENTS map plus helpers rewrite retired model IDs in the Unbound provider’s models list and upgrade agents.defaults.model.primary when it still references a retired id (provider prefix preserved).

Users who only had a stale baseUrl update path are unchanged; reruns without --model now 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.

  • Changes the default provider model to claude-sonnet-4-6.
  • Migrates known retired IDs in the existing Unbound provider model list.
  • Migrates a retired existing primary model while preserving its provider prefix.

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

Filename Overview
openclaw/setup.py Updates the OpenClaw default model and adds rerun migration logic that resolves the previously reported retired-model failure.

Reviews (2): Last reviewed commit: "fix: migrate existing openclaw installs ..." | Re-trigger Greptile

Context used:

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>
@AakashVelusamy
AakashVelusamy requested a review from a team August 20, 2026 08:00

@vigneshsubbiah16 vigneshsubbiah16 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed to authenticate: OAuth session expired and could not be refreshed


🤖 consensus review · reviewers: Cursor,Claude,Semgrep,Gitleaks · head 39f3a14d · 2026-08-20T08:00Z

Comment thread openclaw/setup.py
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 vigneshsubbiah16 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed to authenticate: OAuth session expired and could not be refreshed


🤖 consensus review · reviewers: Cursor,Claude,Semgrep,Gitleaks · head ed4d7341 · 2026-08-20T09:10Z

@AakashVelusamy

Copy link
Copy Markdown
Contributor Author

Comment-disposition audit — head ed4d7341

Every review finding and inline comment on this PR, with its disposition.

Greptile Review

# 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 ⚠️ Did not run — "Failed to authenticate: OAuth session expired and could not be refreshed", on both 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 else branches that previously only printed a message. No existing branch was removed and no signature changed; --model and 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

@AakashVelusamy
AakashVelusamy changed the base branch from main to staging August 20, 2026 11:46
@AakashVelusamy
AakashVelusamy merged commit 9fdacf7 into staging Aug 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants