qwen-code/docs/design/slash-command-feedback.md
Dragon 011303239e
fix(cli): improve slash command history feedback (#8365)
* fix(cli): improve slash command history feedback

* fix(cli): centralize auxiliary model guard

* test(cli): cover model picker left key

* fix(cli): persist slash command invocation hiding across resume

* fix: keep model picker feedback consistent

* docs(cli): align design doc with /stats root-level hiding

* fix(cli): preserve model picker history safely

* fix: preserve hidden command feedback on resume

* fix(desktop): match slash results to invocations

* fix: keep slash command feedback paired with invocations

- Record message-type command results through the recording wrapper so
  rejections and errors land in the result record and replay on resume
- Move the NO_COLOR /theme rejection into the command action so the result
  record is written after the invocation, and keep that invocation visible
  because the command prints feedback instead of opening the dialog
- Skip the /auth result record when the dialog auto-opened without an
  /auth invocation to pair with
- Guard the model picker against re-entering a selection while a switch
  is already in flight
- Walk only uuid -> parentUuid links when matching desktop slash results
  to invocations instead of retaining every parsed transcript record

* fix(desktop): bound slash result lookup to user turn

* test(cli): cover hidden command result replay on resume

* fix(cli): guard dialog result recording

* fix(cli,desktop): tighten slash-command feedback recording

- Pin the revealed invocation as the first history item in the
  argument-validation reveal test, matching the processor's ordering.
- Derive the /model picker-flag pattern from a single shared flag list.
- Pair each transcript invocation with at most one result during desktop
  reconstruction, so a later same-name orphan result (e.g. an auto-fired
  recap) cannot re-emit an already-paired invocation's user row.
- Retarget the textElements guard at the synthesized slash user row.

* fix(cli): guard partially persisted model switches

* test(cli): cover isPickerOnlyModelInvocation regex boundaries directly

---------

Co-authored-by: Shaojin Wen <shaojin.wensj@alibaba-inc.com>
Co-authored-by: qwen-code-dev-bot <qwen-code-dev@service.alibaba.com>
Co-authored-by: Qwen Autofix <autofix@qwen-code.dev>
Co-authored-by: qwen-code-dev-bot <qwen-code-dev-bot@users.noreply.github.com>
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-08-12 17:15:01 +00:00

2.2 KiB

Slash command history feedback

Problem

Interactive slash commands are added to the TUI history before their action is known. Commands that only open a dialog can therefore leave a bare invocation behind after the dialog closes. The model picker has the same problem when it is dismissed without a selection.

Design

  • Do not add the built-in /auth, /settings, /status, /help, /theme, /editor, /diff, or /stats invocations to visible TUI history. Bare /effort, /model, and /statusline pickers are hidden too. Their existing UI remains unchanged, as do chat recording and slash-command telemetry. User and project commands that override those names keep their invocation history.
  • Root matches apply to the bare command only; subcommands keep their invocation because they perform work (for example /status paths prints session paths).
  • Resolve the command before adding its invocation so aliases use the canonical command name for this decision.
  • Preserve invocations for commands that directly perform work, change session state, write data, or enter a management/security workflow. Argument-sensitive commands only hide their bare picker form; for example, /effort is hidden while /effort high remains visible, and /model is hidden while /model <id> remains visible.
  • Commands that fail before opening their dialog keep the invocation paired with the failure message: /theme under NO_COLOR is not hidden because it prints feedback instead of opening the picker, and a hidden picker-shaped /model invocation is revealed when its arguments are rejected.
  • Record the hiding decision in the chat record (hiddenInvocation) so /resume, /branch, and session previews reconstruct the same history the live session displayed instead of bringing the bare invocation row back.
  • When the primary model picker is dismissed without a selection, add an info message identifying the unchanged model. Successful selections keep their existing feedback. The other pickers leave no trace when dismissed; the model picker states the outcome explicitly because the active model is session-critical and otherwise invisible in history, so a silent close would leave it ambiguous whether the model changed.