Expand description
Provider refusal handling shared by the interactive turn loop and the headless runner.
A refusal (FinishReason::Refusal) is terminal for the prompt that caused
it: resending the same prompt is refused again, and any partial output was
cut off by the provider. Both loops stop on a refusal and report the notice
built here, so the wording and the facts it states stay identical across
the TUI, exec JSON output, and subagent results.
Constants§
- REFUSAL_
NOTICE_ PREFIX - Leading text of every refusal notice. Gates that must never treat a
refusal as a recoverable block (auto-continue, recovery turns) match it via
is_refusal_notice.
Functions§
- is_
refusal - Whether
responseended with a provider refusal. - is_
refusal_ notice - Whether
textis a notice produced byrefusal_reason. - refusal_
reason - User-facing explanation for a provider refusal.