Merge pull request #77 from Askhz/fix/commands-dedup-and-filter

fix: 修复 /agents/commands 接口 duplicate command name 和返回多余 TUI 命令
This commit is contained in:
DoSun 2026-05-13 16:57:08 +08:00 committed by GitHub
commit 40a243a94e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -314,7 +314,7 @@ const COMMANDS = memoize((): Command[] => [
// desktop,
context,
contextNonInteractive,
cost,
// cost 已重导出 usage/index.tsname='usage', aliases=['cost','stats']
diff,
doctor,
effort,

View File

@ -32,7 +32,7 @@ export function createInfoRoutes(sessionManager: SessionManager): Hono {
const commands = await getCommands(process.cwd())
return c.json(
commands
.filter(cmd => !cmd.isHidden)
.filter(cmd => !cmd.isHidden && cmd.type === 'prompt')
.map(cmd => ({
name: getCommandName(cmd),
description: cmd.description,