Skip to content

fix(tui): slash command fallback must not block extension commands#3422

Open
tosoyn wants to merge 1 commit intogsd-build:mainfrom
tosoyn:fix/extension-command-fallback
Open

fix(tui): slash command fallback must not block extension commands#3422
tosoyn wants to merge 1 commit intogsd-build:mainfrom
tosoyn:fix/extension-command-fallback

Conversation

@tosoyn
Copy link
Copy Markdown

@tosoyn tosoyn commented Apr 2, 2026

Summary

Fixes #3421

The unknown-command fallback added in 91f0286 (PR #2312, merged into main at 394cb18) returns true for any unrecognised / input before the extension system gets a chance to handle it. This breaks every extension-registered command (/gsd, /kill, /worktree, /exit, etc.).

Affected version: main at 394cb18 (HEAD as of 2026-04-02). Not present in npm v2.58.0.

Changes

  • slash-command-handlers.ts: before showing "Unknown command", check extensionRunner.getCommand(commandName). If the extension owns the command, return false so input-controller falls through to session.prompt() which routes it correctly.

Test plan

  • Start gsd from patched main
  • Verify /gsd executes normally
  • Verify /kill, /worktree, /exit work
  • Verify truly unknown commands (e.g. /asdf) still show the error
  • Verify built-in commands (/help, /model, /settings) still work

🤖 Generated with Claude Code

The unknown-command fallback added in 91f0286 returns true for any
unrecognised "/" input before the extension system gets a chance to
handle it.  This breaks every extension-registered command (/gsd,
/kill, /worktree, /exit, etc.).

Check extensionRunner.getCommand() before showing the error so that
extension commands fall through to session.prompt() as intended.

Affects: main branch at 394cb18 (HEAD), not yet in any npm release.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

🟠 PR Risk Report — HIGH

Files changed 1
Systems affected 2
Overall risk 🟠 HIGH

Affected Systems

Risk System
🟠 high Modes
🟡 medium Commands
File Breakdown
Risk File Systems
🟠 packages/pi-coding-agent/src/modes/interactive/slash-command-handlers.ts Modes, Commands

⚠️ High risk — please run full integration tests and verify tool/extension contracts.

@deseltrus
Copy link
Copy Markdown
Contributor

Related follow-up in #3432: this keeps the extension-command fix but also covers prompt-template and enabled /skill:* slash routing, plus the /export* prefix collision.

@jeremymcs
Copy link
Copy Markdown
Collaborator

@deseltrus can you fix merge conflicts ?

@jeremymcs
Copy link
Copy Markdown
Collaborator

This PR has merge conflicts with the base branch. Please rebase or merge main to resolve before review can proceed.

🤖 Automated PR audit — 2026-04-04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working High Priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(tui): slash command fallback blocks all extension commands (/gsd, /kill, etc.)

4 participants