claude-code - 💡(How to fix) Fix [BUG] Session resume fails with 400 "Invalid model name" until /model is run (regression, started ~mid-May 2026)

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…

Error Message

API Error: 400 400: {'error': 'anthropic_messages: Invalid model name passed in model=claude-sonnet-4-6. Call /v1/models to view available models for your key.'}

Root Cause

Root Cause Hypothesis

Fix Action

Workaround

After resuming, run /model and select the same model (no change needed). The error clears and the session works normally.

Code Example

API Error: 400 400: {'error': 'anthropic_messages: Invalid model name passed in model=claude-sonnet-4-6. Call `/v1/models` to view available models for your key.'}

---

API Error: 400 400: {'error': 'anthropic_messages: Invalid model name passed in model=claude-sonnet-4-6. Call `/v1/models` to view available models for your key.'}
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Since approximately mid-May 2026, every session resume via --resume (or FleetView session resume) fails on the first prompt with:

API Error: 400 400: {'error': 'anthropic_messages: Invalid model name passed in model=claude-sonnet-4-6. Call `/v1/models` to view available models for your key.'}

Running /model in the resumed session — without changing the model (selecting the same claude-sonnet-4-6) — immediately clears the error and subsequent prompts work fine.

This worked correctly for months prior and regressed sometime in the ~2 weeks before 2026-05-28.

The model ID itself is not the problem. claude-sonnet-4-6 is a valid alias in our LiteLLM proxy (which fronts AWS Bedrock). The same model ID works correctly in fresh sessions. Only resumed sessions hit this error, and only until /model is re-run.

What Should Happen?

Session resume should complete model initialization the same way a fresh session does. The /model command should not be required as a workaround after every resume.

Root Cause Hypothesis

--resume appears to restore the saved model ID from the session transcript but skips whatever model initialization step runs during a fresh session start. Running /model re-triggers that initialization as a side effect, even when the selected model doesn't change. Something in a recent release broke this initialization path for resumed sessions.

Workaround

After resuming, run /model and select the same model (no change needed). The error clears and the session works normally.

Error Messages/Logs

API Error: 400 400: {'error': 'anthropic_messages: Invalid model name passed in model=claude-sonnet-4-6. Call `/v1/models` to view available models for your key.'}

Steps to Reproduce

  1. Use Claude Code with a LiteLLM proxy (or similar) fronting an API-compatible backend (e.g. AWS Bedrock)
  2. Start and end a session normally
  3. Resume with claude --resume <session-id>
  4. Send any prompt — observe 400 error
  5. Run /model, select the same model without changing it, send a prompt — observe it now works

Claude Model

claude-sonnet-4-6 (via LiteLLM proxy → AWS Bedrock)

Is this a regression?

Yes — worked correctly for months; regressed approximately mid-May 2026

Last Working Version

Unknown exact version; working prior to ~2026-05-14

Claude Code Version

Latest (as of 2026-05-28)

Platform

Other (LiteLLM proxy / AWS Bedrock)

Operating System

Linux

Terminal/Shell

bash

Additional Information

  • Reproducible on every session resume, 100% of the time
  • The /model workaround works 100% of the time without changing the model ID
  • This is a clear regression — same setup, same model, worked fine before mid-May 2026
  • The fact that re-selecting the same model fixes it strongly points to an initialization-on-resume gap introduced in a recent release

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING