From 69e6f70695e6d2c92d791c05aca84566e2ff6e25 Mon Sep 17 00:00:00 2001 From: joycel-github Date: Thu, 16 Jul 2026 18:04:43 +0000 Subject: [PATCH] fix(harness): wire --state-dir for the Antigravity SDK harness on substrate runAntigravityHarness (the `ax harness antigravity` path used by the substrate ActorTemplate) forked the Python sidecar with only --host/--port. The sidecar then fell back to its own default state dir, so on a substrate actor per-conversation save_dir landed on a path AX does not control, which breaks SDK-native resume across actor Run/Restore and snapshotting. Derive the trajectory dir via antigravity.DefaultStateDir() and pass it as --state-dir, mirroring the local path in antigravity.New and the interactions harness in runAntigravityInteractionsHarness (both own the path internally rather than taking it from ax.yaml/ActorTemplate). Fixes #321 --- cmd/ax/harness.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/ax/harness.go b/cmd/ax/harness.go index 8f2913ef..c028007b 100644 --- a/cmd/ax/harness.go +++ b/cmd/ax/harness.go @@ -31,6 +31,7 @@ import ( "time" "github.com/google/ax/internal/config" + "github.com/google/ax/internal/harness/antigravity" "github.com/google/ax/internal/harness/antigravityinteractions" "github.com/google/ax/internal/pythonsidecar" "github.com/spf13/cobra" @@ -102,11 +103,17 @@ func runAntigravityHarness(cmd *cobra.Command) error { return err } + stateDir, err := antigravity.DefaultStateDir() + if err != nil { + return fmt.Errorf("failed to resolve antigravity state dir: %w", err) + } + cfg := pythonsidecar.Config{ Module: "python.antigravity.harness_server", Args: []string{ "--host", harnessHost, "--port", strconv.Itoa(harnessPort), + "--state-dir", stateDir, }, Stdout: os.Stdout, Stderr: os.Stderr,