Repository navigation
hooks: notification, run beside notify_command (#26 item 5, third event) - #35
Merged
Merged
Conversation
#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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
notificationcommands in admin.jsonhooksrun whenever incode would notify you (a long turn finished, or the agent is waiting on you). Event:notification_type(turn_done/input_needed) andmessage, JSON on stdin, 10 s bound. Run fromcli::notify::deliveron a background thread besidenotify_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:
deliverwith the hook set runs it with the right fields; control (firing removed) fails it.Local (Windows): fmt clean; clippy only the existing
with_tool_serverwarning; lib 2201 passed, bin 59 passed.Still to come: session start/end,
/reviewand/runprompt-hook coverage, PreCompact for automatic compaction.