What
Add the native tool set_thinking_effort(effort, reason) so the model can adjust its own thinking effort mid-task, with an in-chat one-line display. No approval gate (non-destructive, clamped to the model's capability, instantly undoable); guardrails replace approval: always notify, escalation cap (max 3 upward changes per task), oscillation detection, hard clamp.
Part of the Dynamic Thinking Effort series (5 PRs). Master design issue: easonLiangWorldedtech#28.
PR protocol (all series PRs): draft PR until CI is fully green -> switch to ready -> CodeRabbit bot review addressed in full -> 100% test coverage on patch lines. Each PR <= 1000 diff lines, based on latest upstream main (stacked on preceding series PRs where noted; rebased to pure main once dependencies merge).
Stacking: PR 3/5 — stacked on PR 1 (experiment flag) + PR 2 (task state).
Design
- Tool exposed only when the
dynamicThinkingEffort experiment is on and the model supports per-request effort (gating precedents: generate_image / run_slash_command experiments). Tool list stays stable within a task (prompt-cache safety).
- Schema:
effort (enum = the model's supportsReasoningEffort capability array) + reason (required, surfaced in the UI display).
- Executor: clamp vs capability -> guardrails (escalation cap, oscillation) ->
task.setRuntimeThinkingEffort(effort, "model") -> one-line chat display following the switch_mode display pattern (including partial streaming).
- Dispatch wiring:
presentAssistantMessage + NativeToolCallParser cases.
Acceptance criteria
What
Add the native tool
set_thinking_effort(effort, reason)so the model can adjust its own thinking effort mid-task, with an in-chat one-line display. No approval gate (non-destructive, clamped to the model's capability, instantly undoable); guardrails replace approval: always notify, escalation cap (max 3 upward changes per task), oscillation detection, hard clamp.Part of the Dynamic Thinking Effort series (5 PRs). Master design issue: easonLiangWorldedtech#28.
PR protocol (all series PRs): draft PR until CI is fully green -> switch to ready -> CodeRabbit bot review addressed in full -> 100% test coverage on patch lines. Each PR <= 1000 diff lines, based on latest upstream main (stacked on preceding series PRs where noted; rebased to pure main once dependencies merge).
Stacking: PR 3/5 — stacked on PR 1 (experiment flag) + PR 2 (task state).
Design
dynamicThinkingEffortexperiment is on and the model supports per-request effort (gating precedents:generate_image/run_slash_commandexperiments). Tool list stays stable within a task (prompt-cache safety).effort(enum = the model'ssupportsReasoningEffortcapability array) +reason(required, surfaced in the UI display).task.setRuntimeThinkingEffort(effort, "model")-> one-line chat display following theswitch_modedisplay pattern (including partial streaming).presentAssistantMessage+NativeToolCallParsercases.Acceptance criteria