Skip to content

fix: cycle thinking level in lean tui#3246

Merged
dgageot merged 1 commit into
docker:mainfrom
rumpl:lean-tui-shift-tab-thinking
Jun 26, 2026
Merged

fix: cycle thinking level in lean tui#3246
dgageot merged 1 commit into
docker:mainfrom
rumpl:lean-tui-shift-tab-thinking

Conversation

@rumpl

@rumpl rumpl commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

  • Handle Shift+Tab in the lean TUI to cycle the current agent's thinking-effort level
  • Update the lean footer immediately and show a lightweight notice for success/unsupported/error cases
  • Add lean TUI tests for cycling and unsupported models

Validation

  • go test ./pkg/leantui
  • go test ./pkg/app ./pkg/tui ./pkg/leantui
  • go vet ./pkg/leantui
  • go build ./...

Note: task lint could not be run because task is not installed in this environment. go test ./... was attempted and hit unrelated existing/environmental failures in pkg/cache and pkg/rag/treesitter (CGO_ENABLED=1 required).

@rumpl rumpl requested a review from a team as a code owner June 26, 2026 06:34

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

Reviewed pkg/leantui/update.go and pkg/leantui/update_test.go.

The Shift+Tab → handleCycleThinkingLevel implementation is correct:

  • Nil guard on m.app prevents panics before any app is attached.
  • SupportsModelSwitching guard correctly surfaces a user-friendly notice for remote runtimes before attempting the cycle.
  • Error branching handles both runtime.ErrUnsupported (model-specific, shown as muted notice) and generic errors (shown with error styling) without updating m.status.thinking on failure — correct behaviour.
  • Status + notice update on success is appropriately minimal; the synchronous write to m.status.thinking followed by the async TeamInfoEvent from refreshAgentInfo is safe because both writes land on the lean TUI's single event-loop goroutine via the select in leantui.go.
  • Tests cover the success path and the ErrUnsupported path with a well-structured mock.

No bugs found in the changed code.

@aheritier aheritier added area/tui For features/issues/fixes related to the TUI kind/fix PR fixes a bug (maps to fix:). Use on PRs only. labels Jun 26, 2026
@rumpl rumpl force-pushed the lean-tui-shift-tab-thinking branch from 2e43bf9 to 0b2e6b1 Compare June 26, 2026 08:14
@rumpl rumpl force-pushed the lean-tui-shift-tab-thinking branch from 0b2e6b1 to 1317ada Compare June 26, 2026 08:24
@dgageot dgageot merged commit 15a2c92 into docker:main Jun 26, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tui For features/issues/fixes related to the TUI kind/fix PR fixes a bug (maps to fix:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants