From 796d579cf7a70730f85b3e3af141206eb9d715b5 Mon Sep 17 00:00:00 2001 From: Li Fengmin <2080291162@qq.com> Date: Sat, 29 Aug 2026 14:44:48 +0800 Subject: [PATCH 1/2] fix(cli): correct SubagentStop event key in hooks migration Claude Code spells the sub-agent stop event `SubagentStop` (lowercase 'a'), but EVENT_MAPPING keyed it as `SubAgentStop`, so a real Claude configuration's SubagentStop hook never matched and was silently dropped instead of being mapped to AfterAgent. Fixes #29123 --- packages/cli/src/commands/hooks/migrate.test.ts | 2 +- packages/cli/src/commands/hooks/migrate.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/commands/hooks/migrate.test.ts b/packages/cli/src/commands/hooks/migrate.test.ts index 847d7bc4673..dd958c188b5 100644 --- a/packages/cli/src/commands/hooks/migrate.test.ts +++ b/packages/cli/src/commands/hooks/migrate.test.ts @@ -178,7 +178,7 @@ describe('migrate command', () => { PostToolUse: [{ hooks: [{ type: 'command', command: 'echo 2' }] }], UserPromptSubmit: [{ hooks: [{ type: 'command', command: 'echo 3' }] }], Stop: [{ hooks: [{ type: 'command', command: 'echo 4' }] }], - SubAgentStop: [{ hooks: [{ type: 'command', command: 'echo 5' }] }], + SubagentStop: [{ hooks: [{ type: 'command', command: 'echo 5' }] }], SessionStart: [{ hooks: [{ type: 'command', command: 'echo 6' }] }], SessionEnd: [{ hooks: [{ type: 'command', command: 'echo 7' }] }], PreCompact: [{ hooks: [{ type: 'command', command: 'echo 8' }] }], diff --git a/packages/cli/src/commands/hooks/migrate.ts b/packages/cli/src/commands/hooks/migrate.ts index 36bb2cf9aa5..e6a04c551d7 100644 --- a/packages/cli/src/commands/hooks/migrate.ts +++ b/packages/cli/src/commands/hooks/migrate.ts @@ -24,7 +24,7 @@ const EVENT_MAPPING: Record = { PostToolUse: 'AfterTool', UserPromptSubmit: 'BeforeAgent', Stop: 'AfterAgent', - SubAgentStop: 'AfterAgent', // Gemini doesn't have sub-agents, map to AfterAgent + SubagentStop: 'AfterAgent', // Gemini doesn't have sub-agents, map to AfterAgent SessionStart: 'SessionStart', SessionEnd: 'SessionEnd', PreCompact: 'PreCompress', From 7f3a4e0c882b221ba96ce0704e505d4589ceb873 Mon Sep 17 00:00:00 2001 From: Li Fengmin <2080291162@qq.com> Date: Sun, 30 Aug 2026 11:12:55 +0800 Subject: [PATCH 2/2] chore: retrigger CLA check