Repository navigation
feat(cli): relay agy PostToolUse under its own tool names - #1355
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
blafourcade
force-pushed
the
feat/antigravity-relays-stop-and-tool-hooks
branch
from
November 25, 2026 15:29
4181ffe to
77daa1f
Compare
…ss agents and hook matchers Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 task
…de's tool names Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 of 8 tasks
…ugh one shared reader A plugin ships only plain `|` lists, so the regular expression branch and the empty and star cases go; the reader is case-insensitive as the bridges are, and the skipped-group warning has one builder other hosts reuse. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ys-stop-and-tool-hooks # Conflicts: # scripts/__tests__/fixtures/hook-payloads/README.md
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.
🎯 What & why
Relays Antigravity (
agy)PostToolUsehooks under agy's own tool names (write_file,edit_file,run_command), so framework hook scripts fire on the tools agy actually calls. Refs #1194: its PreToolUse part moves to #1342, which adds the neutral refusal every host needs.🛠️ How it works
gemini-3.8-flash-low), docs https://antigravity.google/docs/hooks, in a throwaway project and HOME. Captured payloads:scripts/__tests__/fixtures/hook-payloads/antigravity-PostToolUse.json.edit_file(argsPath,Target,Replacement), notwrite_file. agy reads a matcher as an anchored regular expression over the whole tool name (write_.*fired write_file only,.*_commandrun_command only,write_fnothing).MATCHER_TOOLSincli/src/composition/tool-profiles/antigravity.tsmaps Claude names to agy names; thePostToolUserelay incli/assets/hooks-runtime/host-antigravity.cjs; the wrapped-command merge inwrapped-command-hooks-merge.tsno longer drops a group whose matcher is mapped.continueTurnalready prints{"decision":"continue"}. TheStopblock answer was observed once but not kept as a fixture, so it is not relied on.hooks-routes/antigravity/flat-translate.txt,plugin-install.txt,plugin-install-twice.txt,setup-plugins-reinstall.txt.➕ Added since the first push
hostToolNames(cli/src/contexts/tools/domain/formats/host-tool-names.ts): one shared owner of the rename of plugin tool names to a host's, now used by the agy and Kimi agent tool lists and by hook matchers.|and each piece looked up literally, soEdit.*named no tool and its group was skipped. NowhostToolNamesMatchingreads it as Claude does: a matcher of only word characters and|stays a list of names (order kept); any other is a regular expression tested, unanchored, against each Claude tool name the host has a name for, and the host names it selects are emitted joined by|. An invalid expression throws at build. No shipped plugin writes a regex matcher, so no golden moved.hostToolNamesMatching is not a function(unit), andreads a matcher that is a regular expression, as Claude doesexpected["patch","put|sh"]. Mutation: inverting the regex filter turns exactly the four regex tests red; the plain-name tests stay green.🧪 How to verify
cd cli && pnpm exec vitest run tests/contexts/tools/hooks-runtime.integration.test.tswrite_file,edit_file,run_command;read_fileandupdate_stepsfired nothing.3456fc549:make validate0, pre-commit 0,clipre-push 0 (9921 passed, 1 expected fail, 15 skipped),clibuild 0, bundle 880.5 KB / 897 KB budget.Limits, stated not coded:
PreToolUserelay is not on this branch. Probe facts kept for it:{}denies, empty stdout runs the tool,{"decision":"allow"}runs it,{"decision":"block"}errors (unsupported hook decision: block),{"decision":"deny","reason":...}denies with the reason shown.{}.replace_file_contentandmulti_replace_file_contentare documented but were never seen called; not mapped..*) selects only the three mapped tools, narrower than Claude's every tool.executionNum> 0) is dropped: the framework's one-continuation contract, shared by every adapter, kept.approve/ask/permissionDecisionanswers are not translated: they need the PreToolUse relay, whose neutralrefuseanswer no adapter has yet.docs/COMPATIBILITY.mdand the host tables are not edited here; host conclusions are in the findings file for the owning PR.🔗 Linked issue
Refs #1194
✅ I certify
🤖 Generated with Claude Code