fix(tui): render commands as attachments - #43528
Closed
kitlangton wants to merge 4 commits into
Closed
Conversation
This was referenced Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Render slash commands as first-class command attachments instead of exposing their expanded model-facing templates as user prose.
Before / After
Before: submitting
/mycmd helloevaluated the command template and persisted only the expanded text. The model received the correct prompt, but the transcript also displayedTHIS IS THE EXPANDED TEMPLATE. Argument: hello.After: the same submission persists
{ name: "mycmd", arguments: "hello" }as command provenance alongside the expanded model text. Like a user message containing only a skill attachment, the message has no visible prose and renders only the command attachment badge.How
textfor the model and persist the original command name and arguments separately.Scope
This does not change command template evaluation or the model-visible prompt. Existing messages without command provenance continue rendering their stored text.
Testing
bun turbo typecheck --concurrency=3(pre-push hook, 33 packages)bun run test session-prompt.test.ts session-projector.test.tsinpackages/core(55 passed)bun run test test/mini/session.shared.test.ts test/mini/stream-v2.transport.test.ts test/mini/runtime.queue.test.tsinpackages/tui(78 passed)opencode-drive run ./.scripts/command-display.drive.tsagainst this worktree, asserting/mycmd hellois visible and the expanded template is absentbun run test:benchbefore and after: all 42 performance unit checks passed both times; Playwright preview startup failed identically both times on the existingbun:ESM loader errorDemo
Deterministic OpenCode Drive reproduction with a simulated model.
Before
After
Flow
sequenceDiagram participant UI as TUI / App participant Session as Session.command participant Store as Inbox / Message projection participant Model as Model runner UI->>Session: /mycmd hello Session->>Session: evaluate command template Session->>Store: text = expanded template<br/>command = { name, arguments } Store-->>UI: render command attachment Store-->>Model: send text