Repository navigation
feat(antigravity): persist session state via AX_SESSION_FILE and write output atomically - #25
Merged
aprajitaarora13 merged 1 commit intoNov 19, 2026
Conversation
…e output atomically Follow up on agentexecutor#8 to persist Antigravity CLI (agy) conversation state across suspend/resume and multi-turn sessions via AX_SESSION_FILE, and to write AX_OUTPUT_FILE atomically on exit: - When AX_SESSION_FILE is non-empty, validate the session ID (rejecting path traversal), isolate HOME under <workspace>/.ax/sessions/<id> (overridable via AX_SESSION_HOME), and pass --continue when conversation state already exists (unless spec.config sets continue or conversation). - Deduplicate AX_OUTPUT_FILE / spec.config.outputFile, tee to per-PID temp files, and rename into place on exit. - Wait on the Python arg-parser process substitution so config errors propagate under set -e. - Add unit tests in agents/antigravity/test_harness.sh and document AX_SESSION_FILE in agents/antigravity/README.md. Part of agentexecutor#15.
Collaborator
|
@Lukeluds could you take a look at this one? It's the image side of the session reuse in the hero demo Step 3 (google/ax#643) |
Lukeluds
approved these changes
Nov 19, 2026
Lukeluds
left a comment
Collaborator
There was a problem hiding this comment.
Thanks @aprajitaarora13! This covers #19. I merged it locally with current main (including #9's PATH change): it merges cleanly and all harness tests pass. LGTM, with a few non-blocking suggestions:
- [Suggestion] Moving all of HOME affects more than agy. Every tool the agent runs inside the task (git, ssh, gcloud) now looks in the new, empty HOME, so config or keys mounted under /root (e.g. ~/.gitconfig, ~/.ssh, or a file-based ADC credential under ~/.config/gcloud) won't be found. ADC from the metadata server or GOOGLE_APPLICATION_CREDENTIALS still works. Since agy has no option to move just its data folder, one option is to keep HOME and symlink
~/.gemini/antigravity-cliinto<workspace>/.ax/sessions/<id>. Fine as a follow-up. - [Suggestion] Memory. The workspace is memory-backed (see Grant's 512Mi trial on #9), and conversation data and logs now live there too. A README note next to the minimum limits would help.
- [Suggestion] Leftover temp outputs. If agy is killed or suspended mid-run,
<output>.tmp.<pid>files stay in.ax/. Maybe clean up stale*.tmp.*at startup. - [Suggestion]
ax ssh: a one-line README tip for continuing the session interactively (HOME=/workspace/.ax/sessions/<id> agy --continue).
Could you add "Closes #19" to the description?
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.
Follows up on #8 to persist Antigravity CLI (
agy) conversation state across suspend/resume and multi-turn sessions viaAX_SESSION_FILE, and to writeAX_OUTPUT_FILEatomically on exit:AX_SESSION_FILE): WhenAX_SESSION_FILEis non-empty,ax-harnessvalidates the session ID (rejecting path traversal such as../or/), isolatesHOMEunder<workspace>/.ax/sessions/<sessionId>(overridable viaAX_SESSION_HOME) on the durable workspace volume, and passes--continuewhen conversation files already exist under$HOME/.gemini/antigravity-cli/conversations/(unlessspec.configexplicitly setscontinueorconversation).AX_OUTPUT_FILE/spec.config.outputFile): Deduplicates output paths, tees to per-PID temporary files (<path>.tmp.$$), and renames into place (mv -f) afteragyexits so callers pollingAX_OUTPUT_FILEnever read a partial response.wait "$!"after the Python arg-parsing process substitution so invalidspec.configerrors propagate cleanly underset -e.agents/antigravity/test_harness.shcovering Turn 1 / Turn 2 session resume, explicitcontinue/conversationoverrides, invalid session ID rejection, and deduplicated atomic output writes; updatesagents/antigravity/README.md.Verified:
./agents/antigravity/test_harness.shpasses all 18 tests.write_file) → suspend/resume (0 extra model requests) → Turn 2 (--continuereusing 1 conversation DB with both turns intranscript.jsonl) againstmock-geminiwith the mountedax-task-runner(/opt/ax/ax-task-runner).Closes #19.
Part of #15.