Skip to content

feat(tui): argument auto-completion for /toolset-restart#3728

Merged
aheritier merged 1 commit into
mainfrom
feat/toolset-restart-completion
Jul 18, 2026
Merged

feat(tui): argument auto-completion for /toolset-restart#3728
aheritier merged 1 commit into
mainfrom
feat/toolset-restart-completion

Conversation

@aheritier

@aheritier aheritier commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

What

Pressing Tab after /toolset-restart now opens a completion popup listing the current agent's toolsets, so you no longer have to remember or retype exact toolset names.

Screenshot 2026-07-17 at 21 47 31 Screenshot 2026-07-17 at 21 47 10

Behavior

  • Tab-triggered only — the popup opens on Tab, never auto-opening when you type a space.
  • Non-restartable toolsets are shown + annotated — they appear dimmed with a (not restartable) suffix and cannot be selected/submitted, rather than being hidden.
  • Candidate names come from the same source the restart logic matches against, so every suggestion is a valid target.

Design

The completion hook is deliberately command-agnostic:

  • ArgumentCandidate / CompleteArgument on commands.Item
  • an ArgumentCompleter source interface implemented by the command completion source

Only /toolset-restart is wired up in this PR, but the same mechanism can later serve commands like /effort and /drop.

Implementation notes

  • Added Restartable bool to tools.ToolsetStatus (pkg/runtime, pkg/tools).
  • Added a Disabled concept to the completion popup (dimmed style, non-selectable, no ghost preview).
  • New editor method TryStartArgumentCompletion, invoked from the switchFocus/Tab path in tui.go (falls through to focus-switch when not applicable).
  • Uses tea.Sequence for Open+Query so the popup opens with the full item set before the query narrows it.

Testing

  • task build, task test (all packages), and task lint pass.
  • New/updated tests cover disabled-item popup behavior, the ArgumentCompleter source mapping, TryStartArgumentCompletion (guards + successful open + seeded query), argument-mode query narrowing/closing, and the Tab/switchFocus integration.

Reviewed locally: approved, no blocking issues.

Closes #3730


This is part 1 of 2 in a stack made with GitButler:

@aheritier
aheritier requested a review from a team as a code owner July 17, 2026 17:31
@aheritier aheritier added area/runtime Runtime engine, agent loop execution, tool dispatch, loop detection area/tools For features/issues/fixes related to the usage of built-in and MCP tools area/tui For features/issues/fixes related to the TUI kind/feat PR adds a new feature (maps to feat:). Use on PRs only. status/needs-rebase PR has merge conflicts or is out of date with main labels Jul 17, 2026
@aheritier
aheritier marked this pull request as draft July 17, 2026 17:34
@aheritier

This comment was marked as resolved.

@aheritier
aheritier force-pushed the feat/toolset-restart-completion branch from fa3d752 to d60d5c2 Compare July 17, 2026 17:35
@aheritier aheritier removed the status/needs-rebase PR has merge conflicts or is out of date with main label Jul 17, 2026
Pressing Tab after "/toolset-restart " opens a completion popup listing the
current agent's toolsets. Non-restartable toolsets are shown but dimmed and
annotated "(not restartable)", and cannot be selected. The completion opens
only on Tab, never auto-opening on space.

The argument-completion hook (ArgumentCandidate/CompleteArgument on
commands.Item plus the ArgumentCompleter source interface) is command-agnostic
so it can be reused for other commands (e.g. /effort, /drop) later, though only
/toolset-restart is wired up here.
@aheritier
aheritier merged commit 5ca9de6 into main Jul 18, 2026
18 of 26 checks passed
@aheritier
aheritier deleted the feat/toolset-restart-completion branch July 18, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/runtime Runtime engine, agent loop execution, tool dispatch, loop detection area/tools For features/issues/fixes related to the usage of built-in and MCP tools area/tui For features/issues/fixes related to the TUI kind/feat PR adds a new feature (maps to feat:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(tui): argument auto-completion for /toolset-restart

2 participants