qwen-code/packages/cli
易良 23e76ff26d
fix(vscode-companion): fill slash commands into input on Enter instead of auto-submitting (#3618)
* fix(vscode-companion): fill slash commands into input on Enter instead of auto-submitting (#1990)

Previously, selecting any slash command from the VSCode completion menu
via Enter would immediately send it to the agent, giving users no chance
to append arguments. This was especially problematic for skills and
custom commands that accept parameters.

Changes:
- Commands that accept input (skills, commands with completion) now fill
  into the input box on Enter, letting users type arguments before
  submitting
- No-arg built-in commands (/clear, /doctor, etc.) still auto-submit
  on Enter for convenience
- Tab always fills without submitting (unchanged)
- Client-side commands (/auth, /account, /model) still execute
  immediately (unchanged)

The distinction is driven by the ACP `input` field: Session.ts now sets
`input: { hint }` for commands that accept arguments (non-BUILT_IN kind
or commands with completion functions), and `input: null` for the rest.

Also fixes:
- /auth + /login unified handling in useMessageSubmit.ts
- authCancelled message now clears waiting state (prevents input lockup)
- Stale /login comment updated to /auth in WebViewProvider.ts

Resolves #1990

* fix(acp): derive input field from argumentHint and subCommands, not just kind+completion

The previous logic only checked `kind !== BUILT_IN || completion != null`
to decide whether a command accepts arguments. This caused built-in
commands like /bug, /context, /export, /language, and /stats to be
marked as no-input (auto-submit on Enter), even though they accept
meaningful arguments or have subcommands.

Now a command is considered to accept input when any of:
- it is not a BUILT_IN command
- it has a completion function
- it declares an argumentHint
- it has subCommands

Also adds argumentHint to /bug since it accepts a description but has
neither completion nor subCommands.

* fix(vscode-companion): strip U+200B from completion insertion path

The contentEditable input uses U+200B as a height placeholder. When
selecting a completion item, the raw textContent was used directly for
computing trigger position and building the new text, which could
preserve the hidden character and produce text like "\u200B/commit"
that downstream slash-command handling may not recognize.

Now strip zero-width spaces from the text before computing cursor
position and trigger offsets, and adjust the cursor for any removed
characters so the final inserted text is placeholder-free.

* fix(vscode-companion): add stripZeroWidthSpaces to @qwen-code/webui mock in App.test.tsx

The test mock for @qwen-code/webui was missing the newly imported
stripZeroWidthSpaces function, causing 4 test failures in CI.
2026-04-30 15:24:47 +08:00
..
src fix(vscode-companion): fill slash commands into input on Enter instead of auto-submitting (#3618) 2026-04-30 15:24:47 +08:00
index.ts feat(core): detect tool validation retry loops and inject stop directive (#3178) 2026-04-18 10:24:46 +08:00
package.json chore(release): bump version to 0.15.3 (#3708) 2026-04-28 21:04:52 +08:00
test-setup.ts fix: prevent bogus shell permission rules in tests 2026-03-20 17:55:33 +08:00
tsconfig.json Merge pull request #2428 from qqqys/feat/mcp_reconnect_error 2026-04-01 16:53:36 +08:00
vitest.config.ts refactor(core): Unify package exports and improve dev experience 2026-02-01 11:59:05 +08:00