From a075310144a8ca8366ed6f389bdec5bc14b865f3 Mon Sep 17 00:00:00 2001 From: yiliang114 <1204183885@qq.com> Date: Fri, 4 Sep 2026 00:37:05 +0800 Subject: [PATCH 1/3] test(cli): give the mock memory command an action The live slash gate added by #10929 only submits when parseSlashCommand resolves a command with an action. The mock memory command had only subCommands, so the two /memory Enter-to-submit tests in InputPrompt.test.tsx failed deterministically on main. The real memoryCommand has an action; align the mock with it. --- packages/cli/src/ui/components/InputPrompt.test.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/cli/src/ui/components/InputPrompt.test.tsx b/packages/cli/src/ui/components/InputPrompt.test.tsx index eeb64a82fad..7a59f5f5b9e 100644 --- a/packages/cli/src/ui/components/InputPrompt.test.tsx +++ b/packages/cli/src/ui/components/InputPrompt.test.tsx @@ -130,6 +130,7 @@ const mockSlashCommands: SlashCommand[] = [ name: 'memory', kind: CommandKind.BUILT_IN, description: 'Manage memory', + action: vi.fn(), subCommands: [ { name: 'show', From 1e5dd89864c9a139dedfd77848319d49714d509e Mon Sep 17 00:00:00 2001 From: yiliang114 <1204183885@qq.com> Date: Fri, 4 Sep 2026 00:51:25 +0800 Subject: [PATCH 2/3] fix(cli): add the missing slashCommands dep to the keypress callback #10929 made the Enter path read slashCommands via parseSlashCommand, but the keypress useCallback never listed it in its dependency array. With --max-warnings 0 this react-hooks/exhaustive-deps warning turns Lint & Static red on main; this restores a clean lint. --- packages/cli/src/ui/components/InputPrompt.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/cli/src/ui/components/InputPrompt.tsx b/packages/cli/src/ui/components/InputPrompt.tsx index c5a2fcbe4e1..77dfc2a704e 100644 --- a/packages/cli/src/ui/components/InputPrompt.tsx +++ b/packages/cli/src/ui/components/InputPrompt.tsx @@ -1892,6 +1892,7 @@ export const InputPrompt: React.FC = ({ [ focus, buffer, + slashCommands, completion, shellModeActive, setShellModeActive, From 9cbd2e146fa3909d43c3c5aedbe484d4bb0d3045 Mon Sep 17 00:00:00 2001 From: yiliang114 <1204183885@qq.com> Date: Thu, 3 Sep 2026 19:47:18 +0000 Subject: [PATCH 3/3] test(cli): note why the mock memory command needs an action --- packages/cli/src/ui/components/InputPrompt.test.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/cli/src/ui/components/InputPrompt.test.tsx b/packages/cli/src/ui/components/InputPrompt.test.tsx index 7a59f5f5b9e..32037e6ac14 100644 --- a/packages/cli/src/ui/components/InputPrompt.test.tsx +++ b/packages/cli/src/ui/components/InputPrompt.test.tsx @@ -130,6 +130,7 @@ const mockSlashCommands: SlashCommand[] = [ name: 'memory', kind: CommandKind.BUILT_IN, description: 'Manage memory', + // InputPrompt's live-slash submit gate requires action !== undefined. action: vi.fn(), subCommands: [ {