Skip to content

feat: make slash completion prefix-first with advisory arguments - #336

Merged
Brian Krabach (bkrabach) merged 2 commits into
mainfrom
experiment/completion-keyboard
Sep 9, 2026
Merged

Brian Krabach (bkrabach) merged 2 commits into
mainfrom
experiment/completion-keyboard

Conversation

@bkrabach

Copy link
Copy Markdown
Collaborator

Summary

Make interactive slash completion prefix-first while keeping argument suggestions optional.

  • Open unselected menus for known arguments as well as slash-command names.
  • Make unselected Tab accept one unique match or extend only the longest common prefix. Repeated Tab does not cycle, and an exact short name remains ambiguous when a longer name also matches.
  • Keep explicit arrow/Shift-Tab selection separate from acceptance. Tab, Enter, or Space accepts a selected item without executing the command.
  • Prefer an exact typed command on unselected command-menu Enter, then a unique match; otherwise keep the menu open with a visible “Type more or choose” hint. Unselected argument-menu Enter submits the typed line unchanged, including with automatic popups disabled.
  • Preserve literal Space editing, avoid duplicate completion delimiters, retain later text during midline completion, and render the ambiguity hint without requiring terminal cursor-position-request support.

The existing ui.slash_popup.enabled setting still defaults to true. Setting it to false disables automatic command and argument menus, not manual Tab completion or advisory argument submission. Command validation, completion metadata, and snapshot-only keypress callbacks are unchanged.

Verification

  • uv run --with truststore pytest -q — 2,183 passed, 1 skipped, 13 deselected, 1 xfailed.
  • uv run --with truststore pytest -q -m integration — 13 passed.
  • uv run --with truststore pytest -q tests/test_interactive_slash_completion.py tests/test_interactive_chat_tty_teardown.py — 74 passed.
  • Ruff checks on the changed Python files passed.
  • Independent source and pre-publication reviews passed.
  • Live DTU keyboard checks passed at 120×40 and 80×24: common-prefix completion, exact short-name acceptance, visible ambiguity guidance in CPR-unsupported terminals, separately paced selection/acceptance, advisory argument submission, popup-disabled manual completion, and clean exits.

The corrected live report retains an overall PARTIAL label because two text-readiness probes timed out. Fresh screenshots immediately afterward confirmed the live session title and prompt before the tested flows; all four corrected keyboard cases passed. The initial failure report is preserved separately. Exact trailing-space counts are covered by real PromptSession pipe tests rather than whitespace-trimming screen captures.

Scope and limitations

  • Updates the implementation, regression tests, and interactive documentation only.
  • No new settings schema, in-app UI controls, shell-completion changes, provider behavior changes, or new skill metadata.
  • Backspace still closes the menu until another character or Tab; that existing limitation is unchanged.
  • Private DTU artifacts, logs, screenshots, fixtures, and local verification directories are not included.

Make slash completion prefix-first while keeping known argument suggestions advisory. Preserve explicit selection semantics, popup settings, and CPR-safe ambiguity guidance with regression coverage and documentation.

Generated with Amplifier

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
Use both prompt-toolkit parser and key-binding timeout controls in Escape timing tests so the test-only follow-up is portable across platforms.

Generated with Amplifier

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
@bkrabach
Brian Krabach (bkrabach) merged commit fee2529 into main Sep 9, 2026
9 checks passed
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