Repository navigation
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.
Problem
maxInitialPromptBytes()caps every cold-start replay at 112 KiB (114,688 bytes) to stay under olderagy's 128 KiB tail truncation onsession/prompt.When a client compacts its context into a 120–160 KiB opening prompt, or replays a long history after a prefix fork or pool eviction, the bridge silently middle-truncates the prompt or omits earlier turns even on
agy 1.5.14, which accepts larger prompts without clipping.Evidence
Direct ACP probes against
agy 1.5.14showed two behaviors:session/promptdelivers a 192,000-byte payload verbatim to the model (head, middle, and tail markers intact; zero bytes omitted).session/resumewithout_meta.antigravity.systemPrompt.appendkeeps thesystemPrompt.appendattached atsession/new.Live end-to-end checks with
gemini-3.8-flashonagy 1.5.14:184000B)AGY_BRIDGE_HISTORY_SEED=1Change
maxInitialPromptBytes(agentVersion)keeps114688bytes foragy < 1.5.14(and unknown versions) and raises the default to184000bytes foragy >= 1.5.14(LARGE_PROMPT_AGY_VERSION).AGY_BRIDGE_MAX_PROMPT_BYTESstill overrides the default. When the budget exceeds 112 KiB, the omission notice uses a generic message instead of citing 112 KiB.AGY_BRIDGE_HISTORY_SEED=1, default off). When a cold replay still overflowsmaxInitialPromptBytes,planHistorySeedmoves overflowing earlierhistoryturns (or leading user messages in a multi-user opening turn) into a cloaked (outgoing())_meta.antigravity.systemPrompt.appendblock onsession/new, capped byAGY_BRIDGE_HISTORY_SEED_MAX_BYTES(default 512 KiB).Procand parked session records persisthasHistorySeed, andsession/resumeomits_metawhenhasHistorySeedis set soagykeeps the seeded context. The option defaults to off because Antigravity can return 429 for somesystemPrompt.appendpayloads.seed_messagesandseed_bytes.README.mdandREADME.en.mddocument the version-gated default and the new env vars.package.jsonbumps0.1.113to0.1.114.Tests
packages/agy-cli/test/replay-budget.mjs(registered inpackages/agy-cli/agy-cli.test.mjs) checks:agy 1.5.0keeps the 112 KiB budget and clips a 150 KiB prompt;agy 1.5.14raises the default budget to184000bytes and sends a 150 KiB prompt verbatim;AGY_BRIDGE_HISTORY_SEED=1seeds overflowinghistoryand overflowing multi-user opening turns into cloakedsession/new_meta.antigravity.systemPrompt.append, enforcesAGY_BRIDGE_HISTORY_SEED_MAX_BYTES, reportsseed_messages/seed_bytes, and omits_metaonsession/resumeso the seeded context survives resume.bun scripts/check.mjs agy-clipasses (registry.jsonandagy-cli).bun scripts/bumped.mjs upstream/mainpasses.bun test packages/agy-cli/agy-cli.test.mjspasses (26 pass, 0 fail).agy 1.5.14(gemini-3.8-flash) passed for both the 149 KiB default-budget prompt and the 229 KiB seeded replay with turn-2 cache hits.