Skip to content

fix(antigravity): follow-ups for managed-agent image (#30) - #31

Merged
mayawang merged 1 commit into
mainfrom
fix/antigravity-managed-followups
Nov 24, 2026
Merged

mayawang merged 1 commit into
mainfrom
fix/antigravity-managed-followups

Conversation

@mayawang

Copy link
Copy Markdown
Collaborator

Follow-up fixes from #30 (6648113):

  • CA bundle errors (antigravity/api.go, antigravity/main.go): Fail fast when an explicit AX_CA_BUNDLE or SSL_CERT_FILE cannot be read or has no valid PEM certificates, rather than silently falling back to system roots. The default egress trust-bundle path stays optional when absent.
  • Preserve explicit previousInteractionId (antigravity/main.go): Only default previous_interaction_id to st.LastInteractionID when spec.config.previousInteractionId was not set by the caller.
  • Terminal error cleanup (antigravity/main.go): Cancel in-flight interactions (bounded 15s timeout), clear st.Pending, and run finish() on terminal failures (requires_action, spec.config.timeout, maxContinuations, worker crash giving up) so a relaunched task cannot reattach to a cancelled interaction and one-off tasks delete their remote environment. Also delete a newly created environment if worker.start() or initial interaction creation fails, and remove leftover writeAtomic temp files on error. Transient getInteraction poll errors still preserve st.Pending for reattach.
  • Shutdown timing (antigravity/worker.go, antigravity/main.go): Reduce workerStopTimeout from 10s to 5s so gemini-api exits ahead of ax-runner's 10s stopGracePeriod before SIGKILL. Align createTimeout with the 1m http.Client timeout in api.go.
  • Launcher symlink (antigravity/Dockerfile): Link /usr/local/bin/ax-launcher instead of the deprecated ax-harness path (follows runner: rename the default launcher from ax-harness to ax-launcher google/ax#734).
  • CI (ci.yaml): Run go vet ./... and go test -race -count=1 ./... in antigravity/ on pull requests and main.
  • Docs (antigravity/README.md): Note how AX_SESSION_FILE currently interacts with ax-server defaulting spec.sessionId to metadata.uid.

Open questions (kept out of this PR)

  1. spec.sessionId default: google/ax currently sets spec.sessionId = metadata.uid when omitted (internal/server/server.go:269), so AX_SESSION_FILE is always non-empty on server-created tasks and deleteEnvironment never runs. Recommend leaving spec.sessionId empty in ax-server for one-off tasks so the launcher cleans up automatically without extra config keys.
  2. Release catalog name: .github/workflows/release.yaml currently builds agents/antigravity as ghcr.io/agentexecutor/antigravity. Recommend wiring this image separately (for example antigravity-managed) until the egress gateway supports WebSocket credential injection, keeping existing images secret-free.

Verification

  • ./scripts/verify/boilerplate.sh (pass)
  • cd antigravity && go vet ./... (clean)
  • cd antigravity && go test -race -count=1 ./... (all unit tests pass, incl. new coverage for TestSessionPreservesExplicitPreviousInteractionID, TestRequiresActionClearsPendingAndDeletesEnv, TestTimeoutCancelsAndCleansUp, TestWorkerStartFailureDeletesEnv, TestCABundleErrors)
  • cd antigravity && go build . (clean)
  • gofmt -l antigravity/ (clean)
  • Note: docker build ./antigravity was not executed locally (no Docker socket in this environment).

…cher symlink

Follow up on review items from #30 (6648113):

- api.go / main.go: fail fast with a clear error when a configured CA bundle
  (SSL_CERT_FILE or explicit AX_CA_BUNDLE) cannot be read or contains no valid
  PEM certificates, instead of silently falling back to system roots.
- main.go: preserve an explicit spec.config.previousInteractionId on session
  follow-up turns instead of overwriting it with st.LastInteractionID.
- main.go: cancel in-flight interactions and clear st.Pending / run finish() on
  terminal errors (requires_action, spec.config.timeout, maxContinuations,
  worker crash giving up), and delete newly created environments on worker
  start failure or initial create failure. Bound remote cancel/delete calls
  with a 15s timeout and clean up atomic write temp files on error.
- worker.go: lower worker stop timeout from 10s to 5s so gemini-api exits ahead
  of ax-runner's 10s SIGTERM grace period before SIGKILL. Align createTimeout
  with api.go's 1m http.Client timeout.
- Dockerfile: link /usr/local/bin/ax-launcher instead of deprecated ax-harness
  (follows google/ax#734).
- README.md: document the current google/ax spec.sessionId defaulting behavior.
- ci.yaml: add a go vet and go test -race job for antigravity/.

Verification:
- ./scripts/verify/boilerplate.sh (pass)
- cd antigravity && go vet ./... (clean)
- cd antigravity && go test -race -count=1 ./... (all 18 tests/subtests pass)
- cd antigravity && go build ./ (binary builds cleanly)
- gofmt -l antigravity/ (clean)
- python3 yaml.safe_load check on .github/workflows/ci.yaml (valid)
- Note: docker build ./antigravity was not run locally (no Docker socket)
@mayawang
mayawang requested a review from rakyll November 24, 2026 01:43
@mayawang
mayawang merged commit 78b89d7 into main Nov 24, 2026
4 checks passed
@rakyll
rakyll deleted the fix/antigravity-managed-followups branch November 24, 2026 20:07
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.

2 participants