Files
ARTEX/server
Mike ReadandClaude Opus 5.5 03e216d032 fix: report provider refusals, do not rerun them as idle turns
A turn the provider's safety system declines (Anthropic stop_reason
"refusal", OpenAI-compatible finish_reason "content_filter") has no text
and no tool calls. Norma passes the stop reason through and the harness
ends any tool-less turn with ReasonCompleted, so the run summary said the
model "ended this turn normally", and steerHooks.Stop took the empty turn
for an idle one and resent the conversation up to the empty-response retry
count.

The LLM recorder is the one layer that sees the stop reason. It now hands
each completed call's stop reason to an optional context sink
(llmrec.WithStopSink). captureRunSession installs a per-run tracker
(agent.WithStopTracker) on that sink. With it:

- steerHooks.Stop does not inject the idle-turn rerun after a refusal;
- terminalText reports "provider refusal (stop_reason ...)" and says the
  intent was not completed, instead of the completed wording.

Other terminal states and ordinary empty turns are unchanged.

Fixes #327

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 00:41:18 -06:00
..
2026-07-26 04:27:45 -04:00
2026-07-26 04:27:45 -04:00
2026-08-24 14:14:15 +08:00
2026-08-24 14:14:15 +08:00
2026-08-28 12:56:29 +08:00
2026-10-23 18:12:38 -03:00
2026-08-25 12:05:26 +08:00
2026-08-25 12:05:26 +08:00