feat(cli): relay Stop, PostToolUse and PreToolUse to Antigravity (agy), not only SessionStart
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 44/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- cli
调研方向
Start with cli/src/contexts/tools/domain/profiles/antigravity/antigravity-hooks.ts and its MAPPED_EVENTS, then read tool-paths.md and the prior hook work in #890, #511, and #978. Verify how the profile maps event names, matchers, and hook outputs against the observed agy contracts, including PostInvocation context injection. Done means the acceptance criteria pass, including a guarded Stop continuation and an allow response for empty PreToolUse output.
由索引模型根据 Issue 内容生成。
描述
Problem
On next, the Antigravity profile relays only SessionStart (cli/src/contexts/tools/domain/profiles/antigravity/antigravity-hooks.ts, MAPPED_EVENTS), with the reason "Claude and agy name their tools differently". tool-paths.md lists PreToolUse, PostToolUse and Stop as supported by the host. A hook on any of those three does nothing on agy.
Measured on 2026-11-11 with agy -p (1.5.x, the binary auto-updated from 1.5.1 to 1.5.5 during the test), project file .agents/hooks.json, disposable folder:
SessionStart,PreToolUse,PostToolUse,Stopall fire.agyalso hasPreInvocationandPostInvocation. It has noUserPromptSubmit,SubagentStoporSessionEnd.- Tool names differ:
write_file(argsPath,Content) andrun_command(argsCommandLine), notWriteandBash. - Output contract differs from the framework's scripts: a
Stophook continues the agent with{"decision":"continue","reason":...}. An empty output from aPreToolUsehook is a denial, so a script that prints nothing blocks every tool call.{"decision":"allow"}is required. PostToolUsecould not inject context (documented as{}only).PostInvocationinjected it with{"injectSteps":[{"systemMessage":{"systemMessage":"..."}}]}.- In
-p, tools are refused unless permissions are skipped, which matters for CI. - Not tested:
--settings, subagent hooks. One run per test, small model.
Scope
- Relay
StopandPostToolUse(andPreToolUseonce its output contract is handled) toagy, with matchers translated (Bashtorun_command,WriteandEdittowrite_file). - Translate the hook output (
blocktocontinue, an emptyPreToolUseoutput toallow), or document that scripts must handle it. - Decide how
PostToolUsecontext injection works onagy(PostInvocation).
Acceptance criteria
- A
Stopscript that blocks once continues the turn onagy, with a guard that stops the loop. - A
PostToolUsescript runs afterwrite_fileandrun_command. - A
PreToolUsescript that prints nothing does not deny every tool call. - Events the profile does not relay produce a warning at build time (today: the
unmapped eventmessage already exists for the profile).
Prior art in this repo
antigravity-hooks.ts(MAPPED_EVENTS = {"SessionStart"}), #890 (hooks are read fromhooks.json, notsettings.json), #511 (Antigravity as a flat host), #978 (verified tool compatibility).
Out of scope
Telling agy to relay UserPromptSubmit or SessionEnd (they do not exist). The Antigravity IDE.
- 主要语言
- TypeScript
- 星标
- 481
- 派生
- 45
- 平均合并
- 1 天 13 小时
- 30 天内合并 PR
- 91
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ai-driven-dev/framework 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 86/100
ai-driven-dev/framework#1311 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 79/100
ai-driven-dev/framework#1244 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
ai-driven-dev/framework#1197 ·
维护者通常 1 天内回复
-
refactor(aidd-context): apply the new skill template to learn可能已有人在做 @blafourcade 于 3 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
ai-driven-dev/framework#1186 · 已指派 1 人 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
ai-driven-dev/framework#1163 · 1 条评论 ·
维护者通常 1 天内回复
查看 ai-driven-dev/framework 的全部 Issue
相似的 Issue
-
db-d1-sqlite: upsert is aliased to updateOne, so payload.kv.set never inserts new keys可能已有人在做 @pcbeingused333 今天认领。 未关闭Bug db: d1-sqlite Payload OSS
难度 2/5 1-3 小时 新手友好度 76/100
payloadcms/payload#19766 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
device-management-toolkit/sample-web-ui#3711 ·
维护者通常 1 天内回复
-
bug impact:low Team: SecuritySolution Team:Defend Workflows v9.6.0
难度 2/5 1-3 小时 新手友好度 72/100
elastic/kibana#306401 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
agentes-chat/agentes-chat#927 ·
维护者通常 1 天内回复
-
Closing a pinned tab jumps to the Tabs section instead of the next open pinned tab可能已有人在做 @seenimohamed 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
ardia-browser/ardia#2769 ·
维护者通常 1 天内回复