Repository navigation
feat(cli): carry a session-start context to the model on Antigravity - #1353
Merged
Merged
Conversation
agy hands the model an injectSteps system message returned by a SessionStart hook (probed: the model repeated the injected passphrase). The adapter now answers SessionStart with it; PostToolUse stays unanswered. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 task
blafourcade
marked this pull request as ready for review
November 25, 2026 18:58
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
Antigravity (
agy) hands the model aninjectStepssystem message returned by aSessionStarthook. The adapter now answersSessionStartwith it, so a session-start context reaches the model on Antigravity. Partial work for #1348.🛠️ How it works
cli/assets/hooks-runtime/host-antigravity.cjs:answerprints{"injectSteps":[{"systemMessage":{"systemMessage":"<text>"}}]}atSessionStart, for levels 1 and 2 alike. It prints nothing on empty text, still continues the turn atStop, and still prints nothing atPostToolUse.PreInvocationis not wired. It fires before every model call, and the docs warn that repeated injections fill the context..agents/hooks.jsononly): aSessionStarthook printing a passphrase made the model repeat it; the same shape atPreInvocationdid too. Docs: https://antigravity.google/docs/hooks. A hook command runs from.agents, so a relative path from the project root did not fire on the first attempt. The probe sessions were deleted.antigravity-SessionStart.jsongains a sampleanswer, captured verbatim from the probe run (paths and session id scrubbed).hook-payloads/README.mdgains one line on it.🧪 How to verify
cd cli && pnpm exec vitest run tests/contexts/tools/hooks-runtime.integration.test.tsAssertionError: expected [] to have a length of 1 but got +0.SessionStartguard turnsprints nothing for a PostToolUse answerandprints nothing for an answer to no eventred.prints nothing for the text ""red.injectStepsshape turns the captured-run match and the level 1 and level 2 cases red.583868bf1:make validateexit 0;pre-commit --all-filesexit 0 (first run hit the known scripts-tests flake, rerun passed);pre-pushexit 0, 9907 passed, 1 expected fail, 15 skipped;pnpm buildexit 0, 879.4 KB of the 897 KB budget (+0.2 KB, no raise).Limits, not verified:
SessionStarthook answers with text today, so no end-to-end run through a framework hook was made. The wrapper passes non-empty stdout through and adds{}only when stdout is empty.PostToolUseandPostInvocationinjection are not probed.docs/COMPATIBILITY.mdand the08-hook-generatehost tables are not edited; another PR owns them.🔗 Linked issue
Refs #1348
✅ I certify
🤖 Generated with Claude Code