Skip to content

feat: add per-turn reasoning effort selection to chat API#26975

Draft
DanielleMaywood wants to merge 1 commit into
dm/reasoning-effort-1-model-configfrom
dm/reasoning-effort-2-per-turn
Draft

feat: add per-turn reasoning effort selection to chat API#26975
DanielleMaywood wants to merge 1 commit into
dm/reasoning-effort-1-model-configfrom
dm/reasoning-effort-2-per-turn

Conversation

@DanielleMaywood

@DanielleMaywood DanielleMaywood commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Builds on the per-model reasoning_effort {default, max} config to let users pick the reasoning effort per turn, clamped server-side to the model's max.

Changes

  • API: reasoning_effort on CreateChatRequest, CreateChatMessageRequest, and EditChatMessageRequest (400 on values outside the global scale); Chat exposes last_reasoning_effort.
  • Persistence: mirrors the model_config_id flow. The value is stored per message (chat_messages.reasoning_effort), survives queueing (chat_queued_messages.reasoning_effort), and InsertChatMessages updates chats.last_reasoning_effort from the last message in the batch carrying one (unchanged when absent). Editing a message preserves its original effort unless the request overrides it.
  • Generation: the preparer resolves chats.last_reasoning_effort (else the config default), clamps to the config max, and snaps into the provider's supported set. Models without effort config ignore user-supplied values. Subagent chats intentionally start unset and use the model default.

Part of the reasoning effort stack (base: #26974; the chat slider UI follows in #26977).

🤖 Generated by Coder Agents on behalf of @DanielleMaywood

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Docs preview

📖 View docs preview for docs/reference/api/chats.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant