feat(tui): argument auto-completion for /effort#3734
Merged
Conversation
dgageot
previously approved these changes
Jul 18, 2026
dgageot
approved these changes
Jul 18, 2026
aheritier
enabled auto-merge
July 18, 2026 12:20
aheritier
marked this pull request as draft
July 18, 2026 12:20
auto-merge was automatically disabled
July 18, 2026 12:20
Pull request was converted to draft
aheritier
marked this pull request as ready for review
July 18, 2026 12:20
aheritier
enabled auto-merge
July 18, 2026 12:22
Extract the supported-thinking-levels resolution used by applyAgentThinkingLevel into resolveAgentThinkingLevels, shared by both the setter (SetAgentThinkingLevel/CycleAgentThinkingLevel) and a new read-only LocalRuntime.CurrentAgentThinkingLevels. Expose it via App.CurrentAgentThinkingLevels using the same optional-capability pattern as CurrentAgentToolsetStatuses/ContextBreakdown, so remote runtimes and non-reasoning models degrade to nil. This is a behavior-neutral refactor: applyAgentThinkingLevel's existing tests pass unchanged. It lands ahead of the /effort argument-completion wiring (#3731) so completion candidates can never diverge from what SetAgentThinkingLevel actually accepts.
Pressing Tab after "/effort " opens a completion popup listing the current agent's supported reasoning-effort levels, reusing the argument-completion hook shipped for /toolset-restart. Candidates come from LocalRuntime.CurrentAgentThinkingLevels (added in the previous commit), not the static effort vocabulary, so a level offered here is always one SetAgentThinkingLevel actually accepts. Unlike /toolset-restart, unsupported levels are never shown (not even Disabled): the /effort picker dialog already only lists supported levels, and completion should match it exactly. Remote runtimes and non-reasoning models resolve to no supported levels, so the popup simply doesn't open (Tab falls through to the usual focus switch).
aheritier
force-pushed
the
feat/effort-completion
branch
from
July 18, 2026 12:33
475aaf8 to
f40621a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3731.
What
Pressing Tab after
/effortand a space opens a completion popup listing the current model's supported reasoning-effort levels, so you can set the effort without remembering the exact vocabulary.Behavior
Shows only the levels the current model supports — unsupported levels hard-fail on submit, so they're never offered. Candidates are never disabled. No popup changes. On non-reasoning models and remote runtimes, no candidates are offered (Tab falls through).
How
Two commits, reusing the generic argument-completion hook shipped in #3728:
LocalRuntime.CurrentAgentThinkingLevels(ctx), exposed viaApp.CurrentAgentThinkingLevels(ctx)(nil on remote / non-reasoning). The setter now takes a singleEffectiveModels()snapshot and reuses it for both capability resolution and provider recreation — preserving the original single-snapshot semantics (no concurrent-/modelrace) while giving the getter and setter one source of truth.effortCandidates+attachEffortCompletionon thesession.effortcommand, wired inBuildCommandCategories; docs.Tests
SetAgentThinkingLevelaccepts; nil on non-reasoning/remote; a concurrency regression test that mutates the override between resolution and application (verified to fail against a double-snapshot implementation)./effort.Reviewed locally: approved, race-targeted tests pass, no blocking issues.
Note
Stacked on #3728 (
feat/toolset-restart-completion), which carries the generic hook. Merge after #3728.