From eef6c2a2faf76d4bf742e144297054996cef7418 Mon Sep 17 00:00:00 2001 From: nuthalapativarun Date: Tue, 23 Jun 2026 12:55:50 -0700 Subject: [PATCH] fix: remove unused SubagentStart/SubagentStop hook events (#9960) Signed-off-by: Varun Nuthalapati --- crates/goose/src/hooks/mod.rs | 6 ------ documentation/docs/guides/context-engineering/hooks.md | 1 + 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/crates/goose/src/hooks/mod.rs b/crates/goose/src/hooks/mod.rs index c333e9a4c0..d856680383 100644 --- a/crates/goose/src/hooks/mod.rs +++ b/crates/goose/src/hooks/mod.rs @@ -59,8 +59,6 @@ pub enum HookEvent { BeforeShellExecution, AfterShellExecution, Stop, - SubagentStart, - SubagentStop, } impl HookEvent { @@ -77,8 +75,6 @@ impl HookEvent { HookEvent::BeforeShellExecution => "BeforeShellExecution", HookEvent::AfterShellExecution => "AfterShellExecution", HookEvent::Stop => "Stop", - HookEvent::SubagentStart => "SubagentStart", - HookEvent::SubagentStop => "SubagentStop", } } @@ -95,8 +91,6 @@ impl HookEvent { "BeforeShellExecution" => HookEvent::BeforeShellExecution, "AfterShellExecution" => HookEvent::AfterShellExecution, "Stop" => HookEvent::Stop, - "SubagentStart" => HookEvent::SubagentStart, - "SubagentStop" => HookEvent::SubagentStop, _ => return None, }) } diff --git a/documentation/docs/guides/context-engineering/hooks.md b/documentation/docs/guides/context-engineering/hooks.md index baf0d3d96a..cb17b94664 100644 --- a/documentation/docs/guides/context-engineering/hooks.md +++ b/documentation/docs/guides/context-engineering/hooks.md @@ -318,6 +318,7 @@ Check the following: - The command path is correct. Use `${PLUGIN_ROOT}` for scripts inside the plugin. - The script is executable if you call it directly. - The plugin is not listed in `disabledPlugins`. +- The event is not a subagent lifecycle event. `SubagentStart` and `SubagentStop` are not currently emitted by goose, so hooks registered for them will never run. ### My Hook Timed Out or Failed