Skip to content

Interactions: persist interactions harness with durable dir and resume from it#327

Merged
wjjclaud merged 3 commits into
mainfrom
durabledir-interactions
Jul 18, 2026
Merged

Interactions: persist interactions harness with durable dir and resume from it#327
wjjclaud merged 3 commits into
mainfrom
durabledir-interactions

Conversation

@wjjclaud

Copy link
Copy Markdown
Collaborator

The Antigravity interactions harness is built upon a thin Go server, which is fast in terms of start up time. Instead of taking a snapshot of the whole rootfs + memory, we can take snapshot of one durable directory only, and resume from the state under that durable dir. Related issue: #268

Changes

  • The interactions harness write artifacts to workspace by default.
  • Mount durable dir at /workspace, which contains all the artifacts the interactions harness has created, as well as the internal state .ax/antigravityinteractions/cursor
  • Add MkdirAlls in setHarnessWorkDir before chdir call.

Tested

  • Deploy on substrate.
  • Test with interactions harness: write files, update files, execute files across turns.

value: "${GOOGLE_CLOUD_PROJECT}"
- name: AX_HARNESS_WORKDIR
value: "/workspace"
- name: AX_DURABLE_DIR

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What's the different between AX_HARNESS_WORKDIR and AX_DURABLE_DIR? Should we use AX_HARNESS_WORKDIR as the durable dir?

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.

Similar question. iiuc

  1. AX_DURABLE_DIR becomes the base for AX assets, including the cursor store.
  2. AX_HARNESS_WORKDIR is the workspace for local tool execution.

Shall we use the following layout so tool execution doesn’t accidentally affect AX’s internal state?

volumeMounts:
  - name: workspace
    mountPath: /durable

env:
  - name: AX_DURABLE_DIR
    value: /durable
  - name: AX_HARNESS_WORKDIR
    value: /durable/workspace

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.

I think using /durable/.ax/antigravityinteractions/cursor to store the cursor makes sense.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I was thinking about something similar to /durable and /durable/workspace, so I added the AX_DURABLE_DIR. It would work for the SDK harness.
But for the interactions harness, on the server side it has system instructions that specifically says the /workspace directory. I tried changing the workspace to something like /durable/workspace, but it always tries to write to /workspace, which won't live through turns.

I will remove AX_DURABLE_DIR and just use AX_HARNESS_WORKDIR for the scope of this PR since we only add this for interactions.

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.

I think the explicit mentioning of /workspace in the system instruction should be already fixed. Can you start a sherlog to verify what is the full system instruction received by the model?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Adopted the /durable mount path in the comments above. I will merge this PR, but we still need #332 as a follow up.

@wjjclaud
wjjclaud merged commit 5d0e245 into main Jul 18, 2026
9 checks passed
@wjjclaud
wjjclaud deleted the durabledir-interactions branch July 18, 2026 01:03
feifeigood added a commit to feifeigood/ax that referenced this pull request Jul 20, 2026
feifeigood added a commit to feifeigood/ax that referenced this pull request Jul 20, 2026
rakyll pushed a commit that referenced this pull request Jul 21, 2026
google-antigravity 0.1.7's _connect_websocket retries both "localhost"
and "127.0.0.1" when dialing localharness (local_connection.py:993), so
the sidecar no longer needs to patch /etc/hosts for substrate/gVisor
environments where localhost may not resolve.

Ref #325

antigravity: guard conversation_id for safe save_dir use (#312)

harness_server uses the caller-supplied conversation_id directly as a
per-conversation storage directory name (save_dir = state_dir /
conversation_id) before the Antigravity harness ever sees it, so a value
like "../escape" could traverse outside state_dir. Reject an empty id or
one containing a path separator or a "." / ".." component at the boundary
in _run_turn, returning an INVALID_ARGUMENT end frame.

This is intentionally only a path-safety guard, not the id-format
contract. The Antigravity harness owns that: it validates the forwarded
cascade_id (length and character set) per cl/948016352. Keeping the
format rule in one place avoids the two layers drifting.

chore: remove stale docs, gitignore, and Makefile entries (#329)

- CONTRIBUTING.md: drop 'make run-remote' (no such Makefile target)
- .gitignore: remove orphaned entries (local/remote_agent, sandbox-router,
  tasklog, axepp, google-cloud-sdk, test-sandbox-config.yaml)
- Makefile: add missing deps, clean-logs to .PHONY

antigravity: remove vertex env-var override (superseded by AGY 0.1.7) (#331)

* antigravity: remove vertex env-var override (superseded by AGY 0.1.7)

google-antigravity 0.1.7 reads GOOGLE_GENAI_USE_VERTEXAI /
GOOGLE_GENAI_USE_ENTERPRISE + GOOGLE_CLOUD_{PROJECT,LOCATION} natively,
so the sidecar no longer needs _vertex_kwargs_from_env to thread them
into LocalAgentConfig.

- Delete _vertex_kwargs_from_env + VertexKwargs.
- _build_default_config: bare LocalAgentConfig(system_instructions=...).
- _has_credentials: read project/location from env (SDK hydrates them
  onto VertexEndpoint, not LocalAgentConfig).
- Update tests accordingly.

Requires the 0.1.7 bump. Credential resolution is startup-only and
does not touch the save_dir/state_dir resume path.

Ref #325

* antigravity: drop stale _has_credentials docstring note about vertex env override

Interactions: persist interactions harness with durable dir and resume from it (#327)

interactions: make WorkDir authoritative for run_command (#335)

The interactions harness executed run_command relative to the process's
ambient working directory, which is not reliably the agent's workspace: with
no Cwd argument the command ran wherever the process cwd happened to be, and a
model-supplied Cwd (including "/") was honored blindly. As a result tool calls
often ran from "/" instead of the configured workspace (#332).

Make the workspace directory authoritative in the executor rather than relying
on ambient process state:

- Add AntigravityInteractionsConfig.WorkDir (defaults from AX_HARNESS_WORKDIR).
- run_command now resolves its directory via resolveRunDir: no Cwd -> WorkDir;
  relative Cwd -> joined under WorkDir; absolute Cwd -> honored as-is. Empty
  WorkDir preserves the previous process-cwd behavior.
- Add WorkspaceSystemInstruction to orient the agent about its working
  directory so it emits workspace-relative paths, and wire it in cmd/ax.

Fixes #332

Remove the binary (#334)

* Remove the binary

* chore: add e2e directory to .gitignore

* refactor: migrate binary file check to a dedicated workflow file

* fix: restrict binary file check to added, copied, or modified files
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.

4 participants