Skip to content

feat(command): add noReply flag to skip LLM dispatch for display-only commands#27521

Open
PeterPonyu wants to merge 1 commit into
anomalyco:devfrom
PeterPonyu:feat/command-no-reply
Open

feat(command): add noReply flag to skip LLM dispatch for display-only commands#27521
PeterPonyu wants to merge 1 commit into
anomalyco:devfrom
PeterPonyu:feat/command-no-reply

Conversation

@PeterPonyu
Copy link
Copy Markdown

@PeterPonyu PeterPonyu commented May 14, 2026

Issue for this PR

Related: #26022 (existing tracked issue for the same mechanism — that one targets chat.message, this PR targets command.execute.before; same underlying PromptInput.noReply short-circuit).

The companion issue I filed for this PR (#27520) was auto-closed by the compliance bot at 13:07 today for a title-prefix template mismatch (needed [FEATURE]:); see the bot's comment there for the cross-reference to #26022.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds an optional noReply flag to the command schema. When set, the command dispatch path forwards noReply: true to prompt(), which already short-circuits at the existing if (input.noReply === true) return message guard.

Why this matters: a plugin I maintain ships display-only slash commands (panels, confirmations) where the model has nothing useful to say after the command output. Today the command dispatch always invokes the LLM for the next assistant turn, wasting a round-trip. The plugin side can't suppress this — command.execute.before only returns { parts }, chat.message only returns { message, parts }, and session.abort from a hook races the runner becoming busy.

The patch is opt-in and additive. Existing commands without noReply keep their current behavior.

How did you verify your code works?

  • bun run typecheck clean (14/14 tasks)
  • bun test test/session/prompt.test.ts — 53 pass / 0 fail on the cherry-picked branch
  • End-to-end via my fork's TUI: a 20-second baseline window (no input) and a 20-second window after invoking a noReply: true command both show zero service=llm stream lines. On an unpatched build, the post-command window contains the dispatch.

Screenshots / recordings

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

… commands

Some plugins emit panels/confirmations via `command.execute.before` and have
no need for an assistant turn after. Without a way to signal that intent,
the command path always dispatches the LLM, wasting a round-trip per
display-only command.

Adds optional `noReply` to the command schema. When set, the dispatch path
forwards `noReply: true` to `prompt()` which already short-circuits at
prompt.ts:1387.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels May 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

1 participant