Skip to content

feat(tui): add /effort command to select the model's reasoning level#3403

Merged
Sayt-0 merged 1 commit into
mainfrom
feat/effort-command
Jul 2, 2026
Merged

feat(tui): add /effort command to select the model's reasoning level#3403
Sayt-0 merged 1 commit into
mainfrom
feat/effort-command

Conversation

@Sayt-0

@Sayt-0 Sayt-0 commented Jul 2, 2026

Copy link
Copy Markdown
Member

What

New /effort slash command to select the reasoning-effort level of the current model directly, complementing the existing Shift+Tab cycling. Available in both the full TUI and the lean TUI.

Input Behavior
/effort high Sets the level (session override, never persisted to YAML)
/effort Shows usage: none, minimal, low, medium, high, xhigh, max
/effort turbo Error listing valid level names
/effort max on gpt-5 Error listing the levels this model supports
Non-reasoning model / remote runtime Informational message (same as Shift+Tab)

How

  • New Runtime.SetAgentThinkingLevel(ctx, agent, level) interface method
  • Cycle + set share one path: applyAgentThinkingLevel (reasoning check → supported levels via modelinfo.SupportedThinkingLevels → provider re-creation incl. alloy pools → override install)
  • RemoteRuntimeErrUnsupported (server owns model config)
  • App.SetAgentThinkingLevel refreshes agent info so the sidebar updates
  • Success surfaces a toast (full TUI) / notice + status bar update (lean TUI)

Flow

/effort high
   └─ SetThinkingLevelMsg ─ handleSetThinkingLevel (TUI)
        └─ App.SetAgentThinkingLevel
             └─ Runtime.SetAgentThinkingLevel
                  ├─ model reasons? ──no──▶ ErrUnsupported
                  ├─ level supported by model? ──no──▶ error + supported list
                  └─ recreate provider(s) with thinking_budget ─▶ model override

Tests

Area Coverage
pkg/runtime Valid level installs override · unsupported level rejected with supported list · non-reasoning model → ErrUnsupported · per-model top tier (max on Opus 4.7) accepted
pkg/tui/commands /effort high and bare /effort parsing
pkg/leantui Set path updates status · unknown level rejected
Mocks All 5 Runtime mocks updated

Docs

  • /effort row in the TUI slash-command table (docs/features/tui)
  • /effort mentioned alongside Shift+Tab in the thinking guide (docs/guides/thinking)

Validation

  • task build
  • golangci-lint run — 0 issues
  • Tests pass on all touched packages (runtime, app, cli, tui/..., leantui)

@Sayt-0 Sayt-0 requested a review from a team as a code owner July 2, 2026 08:48
@Sayt-0 Sayt-0 merged commit 3949d8a into main Jul 2, 2026
13 checks passed
@Sayt-0 Sayt-0 deleted the feat/effort-command branch July 2, 2026 08:58
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.

2 participants