Skip to content

hooks: notification, run beside notify_command (#26 item 5, third event) - #35

Merged
blockmandev merged 1 commit into
mainfrom
feat/hook-notification
Oct 22, 2026
Merged

blockmandev merged 1 commit into
mainfrom
feat/hook-notification

Conversation

@blockmandev

Copy link
Copy Markdown
Member

notification commands in admin.json hooks run whenever incode would notify you (a long turn finished, or the agent is waiting on you). Event: notification_type (turn_done / input_needed) and message, JSON on stdin, 10 s bound. Run from cli::notify::deliver on a background thread beside notify_command; they cannot change anything and their output is not shown. REPL only, like notifications. A project's plugin cannot contribute it (tool events only, #34).

Test: deliver with the hook set runs it with the right fields; control (firing removed) fails it.

Local (Windows): fmt clean; clippy only the existing with_tool_server warning; lib 2201 passed, bin 59 passed.

Still to come: session start/end, /review and /run prompt-hook coverage, PreCompact for automatic compaction.

#26 item 5, third event. The operator's `notification` hook commands
(admin.json `hooks`, and the operator's own plugins: a project's plugin
gives only the tool events) run whenever incode would notify the person:
a long turn finished, or the agent is waiting on them. The event is JSON
on stdin: hook_event_name Notification, notification_type (turn_done or
input_needed) and message, bounded at 10 s.

They run from cli::notify::deliver on a thread of their own, beside
notify_command, so a slow one never holds up the prompt; they cannot
change anything and what they print is not shown. REPL only, as the
notifications themselves are.

Test: deliver with the hook set runs it, and it is told the kind and the
message. Control: with the firing removed, it never runs.
@blockmandev
blockmandev merged commit f7b3738 into main Oct 22, 2026
7 checks passed
@blockmandev
blockmandev deleted the feat/hook-notification branch November 15, 2026 20:29
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.

1 participant