refactor(chat): remove the dead legacy command execution path - #24
Merged
Conversation
The client posted picked slash commands to /api/commands/execute, a route the server has never served. The path was already unreachable — menu commands are only ever typed app (intercepted locally), skill, or provider (inserted into the composer), so no selection could satisfy the guard — but the dead code still carried a REST executor, a builtin result handler, and a file-open callback that existed only for it.
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.
Follow-up to #4.
Why
Issue #4 (filed against v2.0.0-beta.3) reported three command-surface defects. All three are already fixed on current main with test coverage:
/initrunaway — typed/initis now declined with a local notice (APP_UNSUPPORTED_COMMAND_HINTS) before any gate, andisAppUsableCommandkeeps it out of the slash menu (appUiCommands.test.tsx:241)./transcriptdead end — same notice + menu filter treatment./costmisclassification —/costis anAPP_UI_COMMANDSentry, soclassifyCommandInputresolves it as an app action that opens the cost modal, never reaching the generic Run gate (appUiCommands.test.tsx:125).What remained was the corpse of the legacy path itself:
executeCommandinuseChatComposerStateposted to/api/commands/execute, a route that does not exist anywhere inserver/. It was unreachable —slashCommandsonly ever containsapp(intercepted),skill, andprovider(inserted) types, so the guard requiring none of those could never pass — but dead code that references a phantom endpoint is a trap for the next reader.What changed
executeCommand,showBuiltin,CommandExecutionResult, the deadhandleSubmitbranch, and theonExecuteCommandplumbing inuseSlashCommands(an unclassified menu selection now just resets menu state — unreachable in practice).onFileOpencallback, which existed only for the legacy/memorybuiltin result.Verification
grepconfirms zero remaining references tocommands/execute,executeCommand,showBuiltin,CommandExecutionResult,onExecuteCommandinsrc/.tsc --noEmit(client) and eslint clean.