C:/Program Files/Git/resume causes gateway error when modelOverrides are configured — re-selecting model fixes it

Resolved 💬 2 comments Opened Jun 23, 2026 by cd1amond Closed Jun 23, 2026

Environment

  • Claude Code version: latest
  • Platform: Windows 11 Enterprise + macOS
  • Backend: Corporate LMG gateway (Bedrock IL2) via ANTHROPIC_BASE_URL
  • modelOverrides configured in settings.json mapping canonical ids to deployment-specific ids

Describe the bug

When using /resume to restore a previous session, Claude Code emits a gateway error immediately on startup. The error appears to be the model being resolved before modelOverrides and env vars are fully applied, causing a canonical or bare alias id to be sent to the gateway instead of the mapped deployment id.

Manually re-selecting the same model (e.g. /model sonnet) after /resume immediately fixes the issue — the override map resolves correctly and subsequent requests succeed.

Reproduction steps

  1. Configure modelOverrides in settings.json mapping canonical ids to backend-specific deployment ids (e.g. "claude-sonnet-4-6": "claude-4-6-sonnet-aws-comm-il2[1m]")
  2. Set ANTHROPIC_BASE_URL to a non-Anthropic gateway
  3. Start a session, have a conversation, exit
  4. Run /resume to restore the session
  5. Observe gateway error on the first request

Expected behavior

/resume restores the session with model overrides fully applied, first request succeeds.

Actual behavior

Gateway error (400 or connection failure) on first request after /resume. Re-selecting the model with /model <name> immediately fixes it.

Workaround

Run /model sonnet (or your default) immediately after every /resume.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗