Skip to content

refactor(chat): remove the dead legacy command execution path - #24

Merged
devswha merged 1 commit into
mainfrom
chore/remove-dead-command-execute
Sep 4, 2026
Merged

refactor(chat): remove the dead legacy command execution path#24
devswha merged 1 commit into
mainfrom
chore/remove-dead-command-execute

Conversation

@devswha

@devswha devswha commented Sep 4, 2026

Copy link
Copy Markdown
Owner

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:

  • /init runaway — typed /init is now declined with a local notice (APP_UNSUPPORTED_COMMAND_HINTS) before any gate, and isAppUsableCommand keeps it out of the slash menu (appUiCommands.test.tsx:241).
  • /transcript dead end — same notice + menu filter treatment.
  • /cost misclassification — /cost is an APP_UI_COMMANDS entry, so classifyCommandInput resolves 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: executeCommand in useChatComposerState posted to /api/commands/execute, a route that does not exist anywhere in server/. It was unreachable — slashCommands only ever contains app (intercepted), skill, and provider (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

  • Removed executeCommand, showBuiltin, CommandExecutionResult, the dead handleSubmit branch, and the onExecuteCommand plumbing in useSlashCommands (an unclassified menu selection now just resets menu state — unreachable in practice).
  • Removed the composer's onFileOpen callback, which existed only for the legacy /memory builtin result.

Verification

  • grep confirms zero remaining references to commands/execute, executeCommand, showBuiltin, CommandExecutionResult, onExecuteCommand in src/.
  • appUiCommands + commandDispatchPolicy + commandDispositionMatrix + commandGatePolicy suites: 55/55 pass.
  • tsc --noEmit (client) and eslint clean.

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.
@devswha
devswha merged commit 7314984 into main Sep 4, 2026
2 checks passed
@devswha
devswha deleted the chore/remove-dead-command-execute branch September 4, 2026 13:44
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