Repository navigation
Let plugins add hooks to Claude and Codex - #1579
Draft
johnmatthewtennant wants to merge 7 commits into
Draft
johnmatthewtennant wants to merge 7 commits into
johnmatthewtennant wants to merge 7 commits into
Conversation
Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz> Signed-off-by: John Tennant <jtennant@block.xyz>
Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz> Signed-off-by: John Tennant <jtennant@block.xyz>
Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz> Signed-off-by: John Tennant <jtennant@block.xyz>
Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz> Signed-off-by: John Tennant <jtennant@block.xyz>
Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz> Signed-off-by: John Tennant <jtennant@block.xyz>
Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz> Signed-off-by: John Tennant <jtennant@block.xyz>
Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz> Signed-off-by: John Tennant <jtennant@block.xyz>
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.
Why
Plugins can add agent tools, but cannot require an acknowledgement before an agent uses shell or file tools. A reply-first plugin needs a live enforcement point without replacing the session whenever its setting changes.
What
Add
agents.registerToolHookwith plugin-scoped pre-tool decisions and completion observations. Claude uses SDK hook callbacks. Codex uses authenticated host MCP transports, one per thread start or resume, with trust limited to the bridge’s exact definition. Transport cleanup covers conversations, standalone wakes, compaction, background chat naming and process shutdown. Codex completion observations cover Buzz dynamic tools; Claude also observes native tool completions.A separate reply-first plugin blocks work while a delivered mention awaits a successful public reply in its conversation. The policy and its live setting belong to that plugin. Existing sessions need a one-time restart after installing the bridge. Codex’s native hook transport fails open on transport errors, so this remains a conversational guardrail.
Validation
With fixture model responses, the actual Claude binary blocks shell work, keeps blocking after a failed send, and unlocks after a successful send. The actual Codex binary blocks shell work until a successful send. Single-use HTTP transport fixtures verify independent thread startup and resume while preserving reply-first enforcement. Runtime regressions cover overlapping conversations, background naming, interrupted wakes, compaction and shutdown during transport allocation. Standalone watch and timer tools consult policies with empty mention and destination snapshots, including denial and successful or failed Buzz completion events.
The installed host plus external reply-first plugin has not been exercised end to end.