Repository navigation
fix(server): agy Stop hooks run every turn in T3 and can continue the reply - #26
Closed
orbitingflea wants to merge 1 commit into
Closed
orbitingflea wants to merge 1 commit into
orbitingflea wants to merge 1 commit into
Conversation
… reply Google's agy ACP server runs hooks.json Stop hooks only at session end and ignores `decision: "continue"`, so a Stop hook that works in the agy CLI does nothing in T3. Its hook input also differs from the CLI (UNSPECIFIED instead of NO_TOOL_CALL, a SQLite transcript instead of JSONL). Pin the server to 1.4.3 and, for chat sessions only, launch a patched copy: the Stop bridge becomes an SDK StopHook with CLI-shaped input, a continue reason reaches the chat as a tagged notice before the continued reply, and a cancel stops a running hook. Unknown versions or unexpected bytes fall back to the original server with a warning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Closed: the fix moves to a local patch script; T3 stays unchanged. |
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.
Problem
A Stop hook that works in the agy CLI does nothing in T3's Antigravity provider. Google's ACP server (
agy_acp_server.par) registers hooks.json Stop hooks as a session-end hook, so they run once at teardown and ignore{"decision":"continue","reason":...}. The server also gives hooks different input from the CLI:terminationReasonisUNSPECIFIEDinstead ofNO_TOOL_CALL, andtranscriptPathpoints to a SQLite database instead of JSONL. Google's latest release, 1.4.3, still has the same code.Fix
antigravityRelease.ts), with new archive hashes and sizes for all six platforms.antigravityChatPatch.ts,AntigravityInstallation.chatExecutable). T3 copies the installed PAR to<managed>/patched/<releaseId>-r<rev>/and patches four STORED entries at their original length:hooks.py,server.py, and their.pycfiles, whose magic is broken so the sources load. It updates both CRC fields and publishes the copy with a rename. Each original entry is checked by sha256 first. On any mismatch, unknown version, non-Linux platform, or I/O error, T3 logs a warning and launches the original. Google's files are never changed.AntigravityDriver.ts). Sign-in, model refresh, install validation, and text generation keep the original server.continuekeeps the agent working inside the samesession/prompt.NO_TOOL_CALLand the CLI's other reason names, plus a temporary JSONL transcript with the reply. After a continue, the transcript also holds the CLI'sStop hook blocked terminationsystem message. Hooks written for the CLI, such as ouragy.pyadapter, work unchanged.agent_thought_chunktagged_meta["t3.stop_hook"], between the judged reply and the continued one.adapter.ts,AntigravityProtocol.ts,AntigravityAdapterV2.ts). An Antigravity-only flavor hook turns the tagged chunk into asystem_noticeitem. The user sees the original reply, then a "Stop hook feedback: …" line, then the rewrite as a new assistant message, all in the same turn.Verification
vp run check:changedpasses.chatExecutableand driven by a raw ACP client:HELLO-1, the tagged notice,PINEAPPLE-OK, thenend_turnin a single prompt, and the second hook call allows;agy.py'sclaude_payload()reads the reply andstop_hook_activecorrectly on both calls;cancelledin about 0.1 s, and the next prompt works.Not yet done:
Known limits
_processor.step_queue,_client_cancelled). A new agy version fails the hash check and runs unpatched until the table is updated.executionNumis the zero-based continue count. The CLI's numbering is undocumented (its docs example shows 1), andagy.pydoes not read it.versions/directories already behave the same way.Done with Claude Opus 5.5 in Claude Code (via T3 Code).
🤖 Generated with Claude Code