DD on Discord: through magpie, Claude's safety filter refusing a turn never
makes Claude Code move to its fallback model, as it does on Anthropic's API.
magpie asked every other account and group member (#248), then told Claude
Code a 400 "<model> refused this request", which it takes as an API error.
Claude Code 2.1.296 switches on stop_reason "refusal" in a 200 reply (the
stream's message_delta or a whole message, stop_details giving the
category), and only with a fallback model set; a 400, Anthropic's
"Output blocked by content filtering policy" or magpie's, is never retried.
What changed:
- When nobody is left after a refusal, an agent on Anthropic's Messages API
gets the held refusal itself, the vendor's 200 with stop_reason and
stop_details, streamed or whole (holdWriter.handBack): keyed Anthropic
providers, groups, the Claude subscription. Codex and Chat clients keep
the 400, since an empty-looking whole reply makes Codex ask again.
- Settings' refusalRetries counts how many more candidates (accounts, then
group members, another model among them) a refusal is asked of. Unset is
every one, #248's behaviour (Koohoko asked for it); 0 hands it straight
back. GUI: Settings > Models > Replies > "Ask again after a refusal"
(Never ask again, 1, 2, 3, All), en/zh/zh-TW/ja/de. Global, no CLI:
magpie has no general settings CLI (as noLoopGuard). Other 400s are still
never asked again; refusals still rest nobody.
- disabled-models.test.cjs wheels to Enable, which the new row put past the
window's foot at webkit de 420.
- Docs: reference.md "When the safety filter refuses", gateway-routing.md.
Run:
- go test -tags nogui ./internal/gateway (full, -timeout 40m: a first run
hit the 10m default at load ~70 from other sessions), ./internal/gui,
./internal/settings; gofmt -l clean; GOOS=linux and windows go vet.
- GUI: refusal-retries-setting (en, zh, zh-TW, ja, de at 1100 and 420) with
gui-zh-tw, gui-ja, gui-de, i18n-keys and every tab=models suite
(disabled-models, images-*, loop-guard-setting, member-model-setting,
search-*, searcher-pick, vision-mcp), chromium and webkit: 176 pass.
- refusal-retries-setting under load (8 runs at once, load ~200): first
4 of 8 failed at en/ja 420, a press landing on the first save's "Saved"
note over the row, then WebKit's wheel still moving the view as the
press was measured. It now reaches each button clear of anything drawn
over it (reader.cjs reach) and waits for the scroll to rest: 16 of 16.
Broken by hand:
- handBack off: TestRefusalRetriesNoneHandsClaudeCodeTheRefusal,
...CountsTheTries, ...Group, ...ClaudeSubscription and
TestRefusalWithNobodyLeftIsAnError fail (400 "refused this request").
- count ignored: those plus ...CodexStillTold400 fail (the next key answers).
- GUI keep-on-omit dropped: TestSettingsRefusalRetries fails; the GUI test
fails with All sent as undefined, and with the row not appended.
Not tried: a real Claude account's refusal, or Claude Code's fallback
switch end to end; the refusal shapes are from Claude Code's source and
Anthropic's docs.