Skip to main content

Module refusal

Module refusal 

Source
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 response ended with a provider refusal.
is_refusal_notice
Whether text is a notice produced by refusal_reason.
refusal_reason
User-facing explanation for a provider refusal.