feat(antigravity): populate checkpoint prompt field via condensation-time transcript decoding#1381
feat(antigravity): populate checkpoint prompt field via condensation-time transcript decoding#1381peyton-alt wants to merge 8 commits into
Conversation
…T steps Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… fixture Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tion is implemented Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…on for late-flush agents Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…file extraction) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…n dedup in TranscriptAnalyzer
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit a530791. Configure here.
| count++ | ||
| } | ||
| } | ||
| return count, nil |
There was a problem hiding this comment.
Transcript offset counting mismatch
Medium Severity
Antigravity’s GetTranscriptPosition, ExtractPrompts, and ExtractModifiedFilesFromOffset advance offsets using non-blank JSONL lines, but after condensation CheckpointTranscriptStart is set from countTranscriptItems, which counts physical newline-separated lines (only trailing empties trimmed). Comparing those values in hasNewTranscriptWork and passing checkpointTranscriptStart into the new late-flush prompt path can miss new transcript work or scope prompts/files incorrectly when blank lines appear.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit a530791. Configure here.
There was a problem hiding this comment.
Pull request overview
This PR fixes Antigravity (agy) checkpoints being committed with an empty prompt by re-extracting prompts from the live transcript at condensation time (for agents that implement PromptExtractor). It also implements Antigravity’s prompt extraction and transcript analysis so agy can participate in transcript-based prompt recovery and modified-file extraction.
Changes:
- Add a condensation-time fallback to re-extract prompts from a late-flushed live transcript when
prompt.txtis still empty. - Implement
PromptExtractor+TranscriptAnalyzerfor Antigravity JSONL transcripts (USER_INPUT prompt parsing and mutating tool file detection). - Add unit + integration coverage proving the late-flush prompt recovery end-to-end.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/entire/cli/strategy/manual_commit_condensation.go | Adds a guarded condensation-time fallback to recover prompts from a populated live transcript when existing prompt sources are empty. |
| cmd/entire/cli/strategy/late_flush_prompt_test.go | Unit tests for the new condensation-time prompt recovery helper and its guard behavior. |
| cmd/entire/cli/integration_test/antigravity_test.go | End-to-end integration test reproducing agy’s late transcript flush and asserting committed prompt.txt is recovered at commit time. |
| cmd/entire/cli/agent/antigravity/transcript.go | Implements Antigravity PromptExtractor and TranscriptAnalyzer (offsets, prompt extraction, modified-file extraction). |
| cmd/entire/cli/agent/antigravity/transcript_test.go | Adds focused tests for prompt extraction, offset semantics, transcript position counting, and modified-file path conventions/deduping. |


https://entire.io/gh/entireio/cli/trails/531
Summary
Fills the previously-empty committed checkpoint
"prompt"field for the Antigravity (agy) agent.Root cause: agy writes its transcript file after its
Stophook returns, so the framework's TurnEnd prompt backfill (lifecycle.go) sees an empty transcript andprompt.txtstays empty. Condensation (git commit) re-reads the now-populated live transcript but only read prompts fromprompt.txt— it never re-extracted from the transcript. So agy checkpoints landed with an empty prompt.What changed
agent/antigravity/transcript.go— implementPromptExtractor.ExtractPrompts(parseUSER_INPUTsteps, strip the<USER_REQUEST>wrapper) andTranscriptAnalyzer(GetTranscriptPosition+ExtractModifiedFilesFromOffset, reusing the existingdecodeAgyString/resolveAgySymlinkshelpers). Mirrors the codex template; one sharedagyStepschema, one offset convention.strategy/manual_commit_condensation.go— a generalresolvePromptsFromLateFlushedTranscriptfallback called from both prompt-resolution sites (extractSessionData,extractSessionDataFromLiveTranscript) when prompts are empty, re-extracting from the populated live transcript at condensation. General to anyPromptExtractor; a safe no-op for agents that already capture prompts at TurnStart (guarded bylen(data.Prompts) == 0).Notable
TranscriptAnalyzeralso opts agy into transcript-based modified-file extraction + mid-turn detection (hasNewTranscriptWork), which previously short-circuited. It degrades gracefully (empty transcript → position 0 → no spurious work), and transcript-derived paths matchparsePreToolUse(absolute, symlink-resolved) so they dedupe cleanly with the hook-derived set.OutOfBandTokenSourcetitle-tee, feat(antigravity): native token counts via title-slot tee #1356). No UI changes — the merged entire.ioAntigravityParseralready renders prompts from the transcript.initial_attribution.agent_linesreflects agent work (verified 3 lines / 100% on a real agy checkpoint). Theprompt_attributions[].agent_lines_addeddiagnostic is0at checkpoint 1 by design (a base→last-checkpoint snapshot with no prior checkpoint); it is not the result field. No attribution code changed.write_to_file/replace_file_content/multi_replace_file_content) is duplicated betweentranscript.goandlifecycle.go:parsePreToolUse— could be unified into one shared set.Test plan
mise run checkgreen — gofmt, golangci-lint (0 issues),test:ci(unit + integration + Vogon canary,-race)prompt.txtonentire/checkpoints/v1equals the user's prompt (empty before this fix)TestAntigravity_PromptInCheckpointMetadatawith a verified negative control (empty-transcript-through-commit → test fails), proving the condensation-time path is load-bearing🤖 Generated with Claude Code
Note
Medium Risk
Touches commit-time condensation and checkpoint metadata for all agents that use the empty-prompt fallback, but the path is guarded and only runs when prompts are missing; Antigravity also gains transcript-based file tracking, which could affect mid-turn detection.
Overview
Antigravity checkpoints no longer ship with an empty prompt when the agent flushes its JSONL transcript after
Stop(TurnEnd backfill saw an empty file). The Antigravity agent now implementsPromptExtractorandTranscriptAnalyzer: user text fromUSER_INPUTsteps (stripping<USER_REQUEST>), non-blank line offsets, and deduped paths from mutating tool calls via existingdecodeAgyString/resolveAgySymlinks.Manual-commit condensation adds
resolvePromptsFromLateFlushedTranscript, invoked from both shadow-branch and live-transcript extraction whenprompt.txtis still empty—only for agents that implementPromptExtractor, so other agents are unchanged.Coverage includes unit tests for extraction/offsets/paths, a strategy test for the fallback helper, and integration
TestAntigravity_PromptInCheckpointMetadata(empty transcript through Stop, late populate, then commit assertsprompt.txt).Reviewed by Cursor Bugbot for commit a530791. Configure here.