You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: With switchModelsOnFlag off, Claude safeguard flags end the turn instead of pausing to ask about the fallback model #24043
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
In ~/.claude/settings.json, set "switchModelsOnFlag": false. Claude Code describes this setting as: "When safeguards flag a message, automatically switch to a different model to keep chatting. When off, your session will pause instead."
In T3 Code, use the Claude provider with claude-opus-5-5.
Send a message that the safeguards classifier flags (any [cyber] false positive works).
Expected behavior
The session pauses and asks what to do, like the Claude Code CLI and the Claude apps do: retry the message on the fallback model (Opus 4.8) or stop.
Actual behavior
The turn ends with the plain refusal error and no way to continue:
API Error: Opus 5.5's safeguards flagged this session (https://www.anthropic.com/legal/aup). ...
Claude Code can't respond to your last message with Opus 5.5.
Try rephrasing the request in a new session or change your model.
Details: [cyber]
Root cause: the CLI only pauses with a request_user_dialog of kind refusal_fallback_prompt when the SDK host declares that kind in supportedDialogKinds. Without it, the CLI falls back to the plain refusal error (SDK Options.supportedDialogKinds docs: "for 'refusal_fallback_prompt', the classic refusal error message ends the turn"). ClaudeAdapterV2 declares only ["resume_return"], so the pause the setting promises can never happen in T3.
The dialog payload already carries originalModel and fallbackModel, and the result is one of retry_fallback, edit_prompt or cancelled, so T3 doesn't have to guess the fallback model.
With the default switchModelsOnFlag: true, the CLI switches models silently and T3 shows the notice from #8853, so this only affects users who turned automatic switching off.
Impact
Blocks work completely
Version or commit
main @ d7a8d6f, Claude Code 2.1.309, @anthropic-ai/claude-agent-sdk 0.3.276
Environment
Linux, Claude provider, claude-opus-5-5
Logs or stack traces
API Error: Opus 5.5's safeguards flagged this session (https://www.anthropic.com/legal/aup).Details: [cyber]
Workaround
Set switchModelsOnFlag back to true so the CLI switches models without asking, or switch the thread to Opus 4.8 by hand and resend.
Activity