Skip to content

Issue #465's two ways out are settings, both off unless set, so a live bench can measure them before one is chosen; and every model call's log says what changed in front of what the agent had sent and what became of the thinking it handed back

Decision 815 · accepted · 2026-10-08 · issue #465

Superseded in part

In part by 863.

  • Settings, not a choice. thinking_binding: default | drop_block and system_prompt: per_turn | stable, flat keys any layer may set, each with an environment variable (TROUPE_THINKING_BINDING, TROUPE_SYSTEM_PROMPT) so a bench is run with one on without anyone's file being changed. Enums rather than booleans because the environment layer takes strings. Off, nothing a request carries moves: the provider tests, the prompt tests and the offline bench are as they were.
  • drop_block (option 1) sends anthropic-beta: thinking-binding-controls-2026-08-01 and thinking.block_binding.prefix_mismatch_behavior: "drop_block" on a request that hands thinking back (805's keep_thinking?), and nothing on one that does not. With no effort the thinking field it needs is {type: "adaptive"} and the binding, which is what a model that thinks unasked does with no field; with an effort the binding goes beside the adaptive or budget form 780 sends. The shape is Anthropic's documentation's as read on 2026-10-08; nothing here was sent to the real API. The response's input_transformations entries of type thinking_dropped are counted.
  • stable (option 2) leaves the instruction files and brief, the goal and the task list out of the system prompt (and system_tail empty), and puts each in a <turn_context> block appended to the conversation's last user message when it differs from the copy the conversation already carries: the person's input as a turn begins, after a tool's results when a compaction or a goal comes in the middle of one (the shape Anthropic documents for a per-turn reminder without the clear_at beta). The block stays where it was put on every later call, so a request is always the one before with something added. A section is sent again only when it changed, and one that emptied says so; a compaction empties what was sent, and the sections go again after it. Not chosen: a block on the newest message that moves (an edit, 770 and 792); Anthropic's mid-conversation role: "system" message (not on Sonnet 5, and Troupe's OpenAI-compatible wire has no such thing); every section on every turn (the instruction files again each turn). Not folded: the blocks live in the agent's state, not the log, so an agent restarted sends its next call without them, one edit of the conversation, and puts the sections again then. That, a turn_mode: question turn's plan prompt, and Decision 793's tools offered once there is a list are the prefix changes this does not remove. Where instructions sit is also how a model weighs them; the live bench's follow_up is what says whether they are still followed.
  • What the log says. llm_request carries system_changed and tools_changed against the agent's call before (digests in the state, so absent on an agent's first call and the first after a restart) and turn_context, the sections a stable prompt sent with the call. llm_response carries thinking_resent: true when the call was refused as bound to another conversation and sent again (805's path, until now in no log), and thinking_dropped, the blocks the beta dropped; both absent when nothing happened. Optional fields, no new event, nothing folded: the fold's witness and every fixture hash stand.

Governs: apps/troupe_core/lib/troupe/llm/providers/anthropic.ex, apps/troupe_core/lib/troupe/llm/request.ex, apps/troupe_core/lib/troupe/config/schema.ex, apps/troupe_core/lib/troupe/bench/prefix.ex, apps/troupe_core/lib/troupe/bench/live_scenarios.ex, apps/troupe_core/lib/mix/tasks/troupe.prefix.ex