Repository navigation
feat(agents): expose plugin tool 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
johnmatthewtennant
force-pushed
the
jtennant/zack/agent-hooks
branch
from
October 23, 2026 20:31
cbe4783 to
2d5d922
Compare
johnmatthewtennant
changed the base branch from
main
to
jtennant/aaron/attention-monitor
October 23, 2026 20:31
johnmatthewtennant
force-pushed
the
jtennant/aaron/attention-monitor
branch
from
October 23, 2026 21:03
8e9ab70 to
f11445f
Compare
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: John Tennant <jtennant@block.xyz> Signed-off-by: John Tennant <jtennant@block.xyz>
Zack authored the implementation and tests in 1b75369. This adds the omitted agent credit without amending that commit. Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz> Signed-off-by: John Tennant <jtennant@block.xyz>
johnmatthewtennant
force-pushed
the
jtennant/zack/agent-hooks
branch
from
October 23, 2026 21:04
2d5d922 to
19fd846
Compare
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 contribute agent tools, but cannot intercept calls to shell, file or other tools. They need a live callback for tool policies and completion observations without replacing an active session when plugin settings change.
What
Add
agents.registerToolHookfor Claude and Codex. Plugins receive the agent, session, tool input, conversation and delivered-mention snapshot. A before callback can deny a call with a reason; after callbacks observe success or failure. Registration follows plugin activation and disposal.Claude uses SDK callbacks for native and Buzz tools. Codex uses an authenticated MCP bridge per thread start or resume for native pre-tool decisions, plus before/after callbacks for Buzz tools. Codex native transport errors fail open, so these hooks are conversational guardrails. Other native lifecycle hook events are outside this API.
Validation
Actual Claude and Codex subprocesses with fixture model responses exercised a plugin policy denying shell work until a successful public message. Failed sends retained the denial. Transport fixtures exercised independent concurrent thread startup and resume, cleanup and standalone turns. External-loader Chromium checks exercised plugin activation, settings changes and disposal. The installed Codex session demonstrated denial and successful-send unlocking without restarting that session; native Claude acceptance remains unverified.