Agent host: a local slash command's output is never shown, leaving an empty turn
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
### Summary
A local slash command runs to completion and its output is never shown. The turn ends with an empty assistant bubble, and nothing indicates the command produced anything.
I hit this with `/code-review`, which ran for 11 minutes, produced 13.6 KB of findings, and rendered nothing at all. The findings were recovered afterwards from the SDK transcript on disk.
### Where the output goes
The CLI records the result as a `system` entry with `subtype: local_command`, wrapping the payload:
```
I've completed the review. Here are the findings.
```json
[ { "file": "...", "line": 5271, "summary": "..." }, ... ]
```
It also injects the standard preamble as a `user` entry:
```
Caveat: The messages below were generated by the user while running local
commands. DO NOT respond to these messages or otherwise consider them in your response...
```
So the model correctly produces no assistant text, and the turn is genuinely empty.
### Why nothing renders
Both paths discard it, for defensible reasons that do not hold for stdout:
- **Replay**: `CLI_ECHO_MARKER_PATTERN` in `claudeReplayMapper.ts` matches `command-name`, `command-message`, `command-args`, `local-command-stdout`, `local-command-stderr` and `local-command-caveat`, and drops them so the workbench "doesn't render them as user turns". Correct for the echo markers, but it takes the command's actual output with them.
- **Live**: the recognised `system` subtypes are `compact_boundary` and `notification`. `local_command` is not among them, so the message maps to no signal.
The existing doc comment and the shipped e2e capture both use `Set model to claude-opus-4.7` as the example, which is exactly the case where dropping is harmless. It is not harmless when the command is a review, a build, or anything whose output is the point.
### Impact
Every local slash command is affected. In the terminal CLI the same output prints normally, so the behaviour differs between the two front ends for the same command.
### Suggested fix
Surface `` (and ``) as a response part on the active turn rather than discarding it, while continuing to drop the echo markers and the caveat. The caveat is what keeps the model from responding to it, so rendering the stdout does not change model behaviour, only what the user sees.
*AI disclosure: this issue and the related investigation were written with the assistance of AI.*
### Public patches and patcher scripts
[Public patch catalog and patcher scripts](https://github.com/RyanEwen/vscode-patches/blob/main/CATALOG.md) · [Source patch index](https://github.com/RyanEwen/vscode-patches/blob/main/SOURCE-PATCHES.md). The [public collection](https://github.com/RyanEwen/vscode-patches) includes the maintained patchers, rollback instructions, regression scripts, and historical snapshots. Build restrictions and exact installer coverage are documented there.
Contributor guide
Assessment
This issue has not been assessed yet.