From 4d5c3c13d4b82792844b30a2b9c0eedf003be0e2 Mon Sep 17 00:00:00 2001 From: "paseo-bot[bot]" <266920839+paseo-bot[bot]@users.noreply.github.com> Date: Thu, 15 Oct 2026 12:13:18 +0200 Subject: [PATCH] fix(acp): preserve slash command argument hints (#6920) ACP command updates discarded input hints before the autocomplete command list reached consumers. Preserve the advertised hint, retaining the empty hint for commands without input metadata. Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com> Co-authored-by: bwestlund17 --- .../src/server/agent/providers/acp-agent.ts | 2 +- .../generic-acp-agent.commands.test.ts | 21 ++++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/packages/server/src/server/agent/providers/acp-agent.ts b/packages/server/src/server/agent/providers/acp-agent.ts index 169421fca9..3b61fcb863 100644 --- a/packages/server/src/server/agent/providers/acp-agent.ts +++ b/packages/server/src/server/agent/providers/acp-agent.ts @@ -3098,7 +3098,7 @@ export class ACPAgentSession implements AgentSession, ACPClient { this.cachedCommands = update.availableCommands.map((command) => ({ name: command.name, description: command.description, - argumentHint: "", + argumentHint: command.input?.hint ?? "", kind: "command", })); this.settleCommandsReady(); diff --git a/packages/server/src/server/agent/providers/generic-acp-agent.commands.test.ts b/packages/server/src/server/agent/providers/generic-acp-agent.commands.test.ts index 2411773a7e..3655cccb5b 100644 --- a/packages/server/src/server/agent/providers/generic-acp-agent.commands.test.ts +++ b/packages/server/src/server/agent/providers/generic-acp-agent.commands.test.ts @@ -8,7 +8,7 @@ import { createTestLogger } from "../../../test-utils/test-logger.js"; import { GenericACPAgentClient } from "./generic-acp-agent.js"; describe("GenericACPAgentClient slash commands", () => { - test("lists commands an agent advertises right after session/new", async () => { + test("preserves argument hints in commands advertised right after session/new", async () => { await withFakeACPAgent("commands-after-session-new", async (command, cwd) => { const client = new GenericACPAgentClient({ logger: createTestLogger(), @@ -17,9 +17,17 @@ describe("GenericACPAgentClient slash commands", () => { }); const session = await client.createSession({ provider: "acp", cwd }); try { - await expect(session.listCommands?.()).resolves.toEqual([ - { name: "review", description: "Review the diff", argumentHint: "", kind: "command" }, - ]); + const commands = [ + { + name: "review", + description: "Review the diff", + argumentHint: "query", + kind: "command", + }, + { name: "status", description: "Show status", argumentHint: "", kind: "command" }, + ]; + await expect(session.listCommands?.()).resolves.toEqual(commands); + await expect(session.listCommands?.()).resolves.toEqual(commands); } finally { await session.close(); } @@ -91,7 +99,10 @@ rl.on("line", (line) => { sessionId: "session-1", update: { sessionUpdate: "available_commands_update", - availableCommands: [{ name: "review", description: "Review the diff" }], + availableCommands: [ + { name: "review", description: "Review the diff", input: { hint: "query" } }, + { name: "status", description: "Show status" }, + ], }, }, },