Skip to content

Commit 137963a

Browse files
authored
Merge pull request #2170 from dgageot/fix-thinking
Remove /think command
2 parents 222585c + bc7f5a5 commit 137963a

69 files changed

Lines changed: 2156 additions & 1775 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

agent-schema.json

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -554,20 +554,12 @@
554554
"description": "Whether to track usage"
555555
},
556556
"thinking_budget": {
557-
"description": "Controls reasoning effort/budget. Use 'none' or 0 to disable thinking. OpenAI: string levels ('minimal','low','medium','high'). Anthropic: integer token budget (1024-32768), 'adaptive' (lets the model decide), or effort levels ('low','medium','high','max') which use adaptive thinking with the given effort. Amazon Bedrock (Claude): integer token budget or effort levels ('low','medium','high') mapped to token budgets. Google Gemini 2.5: integer token budget (-1 for dynamic, 0 to disable, 24576 max). Google Gemini 3: string levels ('minimal' Flash only,'low','medium','high'). Thinking is only enabled when explicitly configured.",
557+
"description": "Controls reasoning effort/budget. Use 'none' or 0 to disable thinking. OpenAI: string levels ('minimal','low','medium','high','xhigh'). Anthropic: integer token budget (1024-32768), 'adaptive' (adaptive thinking with high effort by default), 'adaptive/<effort>' where effort is low/medium/high/max (adaptive thinking with specified effort), or effort levels ('low','medium','high','max') which use adaptive thinking with the given effort. Amazon Bedrock (Claude): integer token budget or effort levels ('low','medium','high') mapped to token budgets. Google Gemini 2.5: integer token budget (-1 for dynamic, 0 to disable, 24576 max). Google Gemini 3: string levels ('minimal' Flash only,'low','medium','high'). Thinking is only enabled when explicitly configured.",
558558
"oneOf": [
559559
{
560560
"type": "string",
561-
"enum": [
562-
"none",
563-
"minimal",
564-
"low",
565-
"medium",
566-
"high",
567-
"max",
568-
"adaptive"
569-
],
570-
"description": "Reasoning effort level. 'adaptive'/'max' are Anthropic-specific. Use 'none' to disable thinking."
561+
"pattern": "^(none|minimal|low|medium|high|xhigh|max|adaptive(/low|/medium|/high|/max)?)$",
562+
"description": "Reasoning effort level. 'adaptive' uses adaptive thinking with high effort (default). 'adaptive/<effort>' specifies the effort level (low/medium/high/max). Use 'none' to disable thinking."
571563
},
572564
{
573565
"type": "integer",
@@ -583,8 +575,13 @@
583575
"low",
584576
"medium",
585577
"high",
578+
"xhigh",
586579
"max",
587580
"adaptive",
581+
"adaptive/low",
582+
"adaptive/medium",
583+
"adaptive/high",
584+
"adaptive/max",
588585
-1,
589586
1024,
590587
8192,

cmd/root/run.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -404,10 +404,10 @@ func (f *runExecFlags) createLocalRuntimeAndSession(ctx context.Context, loadRes
404404
slog.Debug("Loaded existing session", "session_id", resolvedID, "session_ref", f.sessionID, "agent", f.agentName)
405405
} else {
406406
wd, _ := os.Getwd()
407-
sess = session.New(f.buildSessionOpts(agent.MaxIterations(), agent.ThinkingConfigured(), wd)...)
407+
sess = session.New(f.buildSessionOpts(agent.MaxIterations(), wd)...)
408408
// Session is stored lazily on first UpdateSession call (when content is added)
409409
// This avoids creating empty sessions in the database
410-
slog.Debug("Using local runtime", "agent", f.agentName, "thinking", agent.ThinkingConfigured())
410+
slog.Debug("Using local runtime", "agent", f.agentName)
411411
}
412412

413413
return localRt, sess, nil
@@ -494,12 +494,11 @@ func (f *runExecFlags) buildAppOpts(args []string) ([]app.Opt, error) {
494494
// buildSessionOpts returns the canonical set of session options derived from
495495
// CLI flags and agent configuration. Both the initial session and spawned
496496
// sessions use this method so their options never drift apart.
497-
func (f *runExecFlags) buildSessionOpts(maxIterations int, thinking bool, workingDir string) []session.Opt {
497+
func (f *runExecFlags) buildSessionOpts(maxIterations int, workingDir string) []session.Opt {
498498
return []session.Opt{
499499
session.WithMaxIterations(maxIterations),
500500
session.WithToolsApproved(f.autoApprove),
501501
session.WithHideToolResults(f.hideToolResults),
502-
session.WithThinking(thinking),
503502
session.WithWorkingDir(workingDir),
504503
}
505504
}
@@ -544,7 +543,7 @@ func (f *runExecFlags) createSessionSpawner(agentSource config.Source, sessStore
544543
}
545544

546545
// Create a new session
547-
newSess := session.New(f.buildSessionOpts(agent.MaxIterations(), agent.ThinkingConfigured(), workingDir)...)
546+
newSess := session.New(f.buildSessionOpts(agent.MaxIterations(), workingDir)...)
548547

549548
// Create cleanup function
550549
cleanup := func() {

docs/configuration/models/index.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,6 @@ Works for all providers:
110110
thinking_budget: none # or 0
111111
```
112112

113-
<div class="callout callout-info">
114-
<div class="callout-title">ℹ️ Runtime Toggle
115-
</div>
116-
<p>Even when thinking is disabled in config, you can enable it during a session using the <code>/think</code> command in the TUI.</p>
117-
118-
</div>
119-
120113
## Interleaved Thinking
121114

122115
For Anthropic and Bedrock Claude models, interleaved thinking allows tool calls during model reasoning. This is enabled by default:

docs/features/api-server/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ All endpoints are under the `/api` prefix.
4949
| `PATCH` | `/api/sessions/:id/permissions` | Update session permissions |
5050
| `POST` | `/api/sessions/:id/resume` | Resume a paused session (after tool confirmation) |
5151
| `POST` | `/api/sessions/:id/tools/toggle` | Toggle auto-approve (YOLO) mode |
52-
| `POST` | `/api/sessions/:id/thinking/toggle` | Toggle thinking/reasoning mode |
5352
| `POST` | `/api/sessions/:id/elicitation` | Respond to an MCP tool elicitation request |
5453

5554
### Agent Execution

docs/features/tui/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ Type `/` during a session to see available commands, or press <kbd>Ctrl</kbd>+<k
4141
| `/sessions` | Browse and load past sessions |
4242
| `/model` | Change the model for the current agent |
4343
| `/theme` | Change the color theme |
44-
| `/think` | Toggle thinking/reasoning mode |
4544
| `/yolo` | Toggle automatic tool call approval |
4645
| `/title` | Set or regenerate session title |
4746
| `/attach` | Attach a file to your message |

e2e/debug_title_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ func TestDebug_Title(t *testing.T) {
1919
{"OpenAI_gpt52pro", "openai/gpt-5.2-pro", "Assistant Capabilities Overview\n"},
2020
{"OpenAI_gpt52codex", "openai/gpt-5.2-codex", "AI Assistant Capabilities\n"},
2121

22-
// Anthopic
22+
// Anthropic
2323
{"Anthropic", "anthropic/claude-haiku-4-5", "AI Assistant Capabilities Overview\n"},
2424
{"Anthropic_Sonnet45", "anthropic/claude-sonnet-4-5", "What can you do?\n"},
2525
{"Anthropic_Opus46", "anthropic/claude-opus-4-6", "AI Assistant Capabilities Overview\n"},
2626

2727
// Google
28-
{"Google_Gemini25FlashLite", "google/gemini-2.5-flash-lite", "AI Capabilities Overview\n"},
28+
{"Google_Gemini25FlashLite", "google/gemini-2.5-flash-lite", "AI capabilities overview\n"},
2929
{"Google_Gemini3ProPreview", "google/gemini-3-pro-preview", "AI Capabilities Inquiry\n"},
3030
}
3131

e2e/exec_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func TestExec_OpenAI_V3Config(t *testing.T) {
2222
}
2323

2424
// TestExec_OpenAI_WithThinkingBudget tests that when thinking_budget is explicitly configured
25-
// in the YAML, thinking is enabled by default (without needing /think command).
25+
// in the YAML, thinking is enabled by default.
2626
func TestExec_OpenAI_WithThinkingBudget(t *testing.T) {
2727
out := runCLI(t, "run", "--exec", "testdata/basic_with_thinking.yaml", "What's 2+2?")
2828

0 commit comments

Comments
 (0)