Antigravity sidecar state dir from config#292
Open
joycel-github wants to merge 3 commits into
Open
Conversation
Sidecar's trajectory storage directory was hardcoded in Python. This
plumbs it through as a yaml config that users can override, matching
the pattern already used for the Interactions harness's state_dir.
Flow:
- ax.yaml: harnesses.antigravity.state_dir (optional; empty = default)
- config.go: AntigravityHarnessConfig.StateDir field (yaml surface only,
no default logic on the Go side)
- cliutil.go: passes yaml value as-is (empty string when unset)
- antigravity Go client: appends --state-dir arg only when non-empty
- Python sidecar: argparse --state-dir with default
~/.ax/antigravity/conversations. Default is a transitional fallback
for substrate mode (where ActorTemplate doesn't inject the flag yet).
Removable once substrate can set the field via ActorTemplate.
Servicer's state_dir is required (no fallback) -- production path always
receives it from argparse; tests pass tmp_path.
Verified end-to-end with ax exec:
- No yaml state_dir -> ~/.ax/antigravity/conversations/{conv_id}/
- yaml state_dir: X -> X/{conv_id}/
- Different conversations remain isolated across both paths.
Closes part of the local-mode gap in issue #269 (harness_config
contract design); a follow-up will do the same for substrate via
ActorTemplate.
- P1: two Python tests referenced tmp_path without declaring the fixture; add tmp_path to their signatures. - P2: state_dir CLI arg was not tilde-expanded, so ~/.ax/... became a literal ~ dir. Add .expanduser(). - P3: no Go-side test asserted --state-dir forwarding. Extract buildSidecarArgs() as a small pure helper and add table test for the empty/non-empty cases, plus a yaml parse test for AntigravityHarnessConfig.StateDir.
Follow-up to review feedback: buildSidecarArgs was overkill for a 3-line conditional. Move it back into New() inline. Also drops the associated TestBuildSidecarArgs (the arg-forwarding rule is now covered only by end-to-end verification).
rakyll
requested changes
Jul 11, 2026
| antigravityHarness, err = antigravity.New(ctx, address, true) | ||
| // Local mode: the harness owns the Python sidecar. Empty StateDir | ||
| // means the sidecar applies its own default | ||
| antigravityHarness, err = antigravity.New(ctx, address, cfg.Harnesses.Antigravity.StateDir, true) |
Member
There was a problem hiding this comment.
Users shouldn't know about state_dir. It's an AGY SDK implementation detail that shouldn't be transparent to AX users.
Instead use the config.AXAssetsDir() to generate a state_dir.
Member
|
I'm approving this to unblock the other changes, but let's address my comment in a follow up. |
rakyll
approved these changes
Jul 11, 2026
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.
Follow-up to #289.
Problem
Sidecar's trajectory storage directory was hardcoded in Python. No way
for users to relocate it.
Fix
Plumb
state_dirthrough:ax.yaml→AntigravityHarnessConfig→ Goclient → sidecar
--state-dirarg. Mirrors the existingantigravity-interactions.state_dirpattern.Python default (
~/.ax/antigravity/conversations) kept as transitionalfallback for substrate mode (ActorTemplate doesn't inject the flag
yet); removable once it does.
Tasks