Repository navigation
fix: declare antigravity-cli Stop hook in the flat form agy accepts - #1240
Open
rubenmarcus wants to merge 1 commit into
Open
rubenmarcus wants to merge 1 commit into
rubenmarcus wants to merge 1 commit into
Conversation
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.
Fixes #1206
What / Why / How
agy rejects the whole plugin hooks.json when Stop carries the grouped matcher/hooks wrapper, so no context-mode hook ever runs under agy. The filer's log line:
failed to parse hooks for plugin ...: invalid hook "hooks": command hook must specify 'command', reproduced on agy 1.2.11. agy's bundled docs table groups only PreToolUse/PostToolUse; Stop must be a flat list of handler objects.Three changes, exactly the files #1206 enumerates:
configs/antigravity-cli/hooks.jsonandconfigs/antigravity-cli/hooks/hooks.json: Stop is now[{ "type": "command", "command": "context-mode hook antigravity-cli stop" }], no wrapper. PreToolUse/PostToolUse stay grouped.src/adapters/antigravity-cli/index.ts:desiredStopis written flat, socontext-mode upgraderepairs existing installs (a legacy grouped Stop is filtered out and replaced, same command).hookEntryHasCommandnow also accepts a handler object whosecommandmatches directly, so ctx_doctor recognizes the flat form in both profiles.tests/adapters/antigravity.test.ts: the grouped-form assertions moved to the flat contract, plus a rewrite test that feeds a legacy grouped Stop throughconfigureAllHooks, and a plugin-profilevalidateHookscase that must reportbest-effort Stop hook also configured.Affected platforms
Test plan
tests/hooks/antigravity-cli-hooks.test.ts(runtime dispatch) is 5 failed / 6 passed on this machine, identical on pristinenext:no session DB createdin the spawned hook process, the failures predate this change. No path handling touched, so no Windows-path risk.Checklist
npm testpasses (touched suite green; environmental failures identical on base, see test plan)npm run typecheckpassesnextbranch (unless hotfix)Prepared with AI assistance (GLM 5.3 via Oh My Pi) and reviewed before submission.