Skip to content

feat(antigravity): persist session state via AX_SESSION_FILE and write output atomically - #25

Merged
aprajitaarora13 merged 1 commit into
agentexecutor:mainfrom
aprajitaarora13:feat/antigravity-session-resume
Nov 19, 2026
Merged

aprajitaarora13 merged 1 commit into
agentexecutor:mainfrom
aprajitaarora13:feat/antigravity-session-resume

Conversation

@aprajitaarora13

@aprajitaarora13 aprajitaarora13 commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Follows up on #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:

  • Durable session state & multi-turn resume (AX_SESSION_FILE): When AX_SESSION_FILE is non-empty, ax-harness validates the session ID (rejecting path traversal such as ../ or /), isolates HOME under <workspace>/.ax/sessions/<sessionId> (overridable via AX_SESSION_HOME) on the durable workspace volume, and passes --continue when conversation files already exist under $HOME/.gemini/antigravity-cli/conversations/ (unless spec.config explicitly sets continue or conversation).
  • Atomic output writes (AX_OUTPUT_FILE / spec.config.outputFile): Deduplicates output paths, tees to per-PID temporary files (<path>.tmp.$$), and renames into place (mv -f) after agy exits so callers polling AX_OUTPUT_FILE never read a partial response.
  • Process substitution exit status: Adds wait "$!" after the Python arg-parsing process substitution so invalid spec.config errors propagate cleanly under set -e.
  • Tests & docs: Adds unit tests 15–18 in agents/antigravity/test_harness.sh covering Turn 1 / Turn 2 session resume, explicit continue/conversation overrides, invalid session ID rejection, and deduplicated atomic output writes; updates agents/antigravity/README.md.

Verified:

  • ./agents/antigravity/test_harness.sh passes all 18 tests.
  • Verified Turn 1 (write_file) → suspend/resume (0 extra model requests) → Turn 2 (--continue reusing 1 conversation DB with both turns in transcript.jsonl) against mock-gemini with the mounted ax-task-runner (/opt/ax/ax-task-runner).

Closes #19.
Part of #15.

…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.
@mayawang

Copy link
Copy Markdown
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 Lukeluds left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. [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-cli into <workspace>/.ax/sessions/<id>. Fine as a follow-up.
  2. [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.
  3. [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.
  4. [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?

@aprajitaarora13
aprajitaarora13 merged commit 0058eac into agentexecutor:main Nov 19, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Antigravity: keep agy session state across turns and suspend/resume

3 participants