You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Add cancellation support for command.execute.before hook #18554
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Summary
Plugins that intercept commands via command.execute.before have no way to cancel the subsequent prompt() call without throwing an error. This causes a 500 response on the web app (error toast + input restoration), even though the plugin handled the command successfully.
Problem
The command.execute.before hook signature returns Promise<void>. There's no way to signal that the command was fully handled and prompt() should be skipped.
The only way to prevent the LLM call is to throw, which propagates through Plugin.trigger() → SessionPrompt.command() → route handler → onError.
TUI: Unaffected (SDK uses throwOnError: false + fire-and-forget).
Web app: Shows "command failed" error toast and restores the input text.
This issue might be a duplicate of existing issues. Please check:
feat: Add noReply option to command.execute.before hook #9306: Very similar request — adding a way to skip the LLM/prompt() call from a command.execute.before hook, with the same motivation (current workaround of throwing an error is hacky). The proposed solutions differ slightly (noReply vs cancelled), but the underlying problem is identical.
Activity
github-actions commentedon Mar 21, 2026
This issue might be a duplicate of existing issues. Please check:
prompt()call from acommand.execute.beforehook, with the same motivation (current workaround of throwing an error is hacky). The proposed solutions differ slightly (noReplyvscancelled), but the underlying problem is identical.github-actions commentedon Jul 4, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.