Skip to content

feat(hooks): expose stop hook via CLI#2627

Merged
derekmisler merged 1 commit intodocker:mainfrom
cogvel:feat/hook-stop-flag
May 4, 2026
Merged

feat(hooks): expose stop hook via CLI#2627
derekmisler merged 1 commit intodocker:mainfrom
cogvel:feat/hook-stop-flag

Conversation

@tdabasinskas
Copy link
Copy Markdown
Contributor

We have a case where we need to capture event when model finishes responding. There's already existing stop hook for that, but it's not exposed via CLI.

- Add a repeatable `--hook-stop` flag that registers shell commands fired by the existing upstream `EventStop` hook (defined in `pkg/hooks/types.go` as "fires when the model finishes its response")
- The hook event itself is already wired into the executor; this PR only plumbs the CLI surface, mirroring the existing `--hook-pre-tool-use`, `--hook-post-tool-use`, `--hook-session-{start,end}`, `--hook-on-user-input` flags
- Threads the new entry through `RuntimeConfig.HookStop`, `HooksFromCLI`, `CLIHooks`, and `Clone`; tests updated to cover both the new flag and the clone-copy path
@tdabasinskas tdabasinskas requested a review from a team as a code owner May 4, 2026 13:07
@derekmisler derekmisler merged commit 957bf80 into docker:main May 4, 2026
6 checks passed
@tdabasinskas tdabasinskas deleted the feat/hook-stop-flag branch May 4, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants