Skip to content

fix(integrations): support Antigravity's new gateway config path - #9219

Merged
lidge-jun merged 2 commits into
lidge-jun:devfrom
ParsifalC:codex/fix-antigravity-config-path
Dec 3, 2026
Merged

lidge-jun merged 2 commits into
lidge-jun:devfrom
ParsifalC:codex/fix-antigravity-config-path

Conversation

@ParsifalC

@ParsifalC ParsifalC commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Antigravity 2.30 and later reads its gateway from ~/.gemini/config/config.json. OpenCodex currently writes only ~/.antigravity/settings.json, so an upgraded Antigravity can show its native models even when OpenCodex reports a connection.

  • Write the gateway to both version-specific settings files so upgrades and older Antigravity releases work without detecting the installed version. Report incomplete configuration as drifted.
  • Preserve each file's original contents in an independently recoverable restore record. Accept existing single-file version-1 records, preflight both files and retain recovery information after partial writes or restores.
  • Update the configuration guidance and translated settings-file errors.

The version boundary and per-version file behavior are documented in Magpie's Antigravity implementation. The installed Antigravity 2.36.0 application bundle on macOS identifies the modern config path.

Verification

After syncing with upstream dev

Synced with dev at 740109d. On the resulting tree at 4d66b25, using Bun 1.4.4 on Linux:

  • bun test --isolate tests/clients/gateway-clients.test.ts tests/clients/gateway-client-restore.test.ts tests/clients/gateway-client-safety.test.ts tests/server/gateway-client-routes.test.ts tests/cli/gateway-client-command.test.ts tests/cli/uninstall.test.ts: 176 passed, 0 failed.
  • bun run typecheck and git diff --check upstream/dev HEAD passed.
  • The full suite and live desktop integration were not rerun. PR CI for this head is awaiting maintainer approval.

Before syncing

  • Bun 1.4.4: bun test --isolate tests/clients/gateway-clients.test.ts tests/clients/gateway-client-restore.test.ts tests/clients/gateway-client-safety.test.ts — 76 passed. After adding the journal-retirement retry regression, bun test --isolate tests/clients/gateway-client-restore.test.ts — 21 passed.
  • bun test --isolate tests/server/gateway-client-routes.test.ts tests/cli/gateway-client-command.test.ts tests/cli/uninstall.test.ts — 99 passed.
  • bun test --isolate tests/ci-workflows/file-size-ratchet.test.ts tests/ci-workflows/structure-ssot.test.ts tests/test-layout.test.ts tests/test-layout-tooling.test.ts — 89 passed.
  • bun run typecheck, bun run privacy:scan, bun run structure:check and git diff --check passed.
  • In gui/, the two gateway client test files passed (7 tests), bun run lint:i18n passed and bun run build passed. In docs-site/, bun run build passed (820 pages).
  • Installed agy 1.5.20 fetched /v1/models and completed a streamed /v1/chat/completions request against an isolated loopback fixture. The same proof passed after deleting the legacy settings file and retaining the connector-generated modern config. It used a fake model and placeholder key.
  • bun run test:changed with loopback permitted: 14,345 passed, 80 skipped and 3 failed across 603 files. Both provider-management failures returned HTTP 400 and reproduced unchanged on upstream dev at 5c350d013261e84fd1b2d965c5b08976a8b7da24. The ocx-child lifecycle test also reproduced there because this machine has neither Cargo nor a prebuilt child binary. The initial sandboxed run could not bind local ports and timed out at 900 seconds.
  • Baseline reproduction used bun test --isolate --timeout 30000 tests/server/management-provider-validation.test.ts tests/providers/kimi-responses-sibling-routes.test.ts --test-name-pattern 'provider POST overwrite preserves an explicit annotateEmptyToolOutputs: false|the sibling row reads the Kimi login and roster' and bun test --isolate tests/clients/link-ocx-child-e2e.test.ts on that upstream commit.
  • The full suite was not run locally because it contains 3,477 test files and includes the unavailable ocx-child prerequisite. Focused regressions and the 603-file changed run are recorded above. Broader coverage is left to CI, whose fork workflows currently await maintainer approval. The desktop app GUI itself has not been exercised against a live provider.

Preview uses the real gateway-client component with fixture data.

Antigravity gateway client showing both settings files and the updated JSON error

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • Required local validation passed; commands, results, and any full-suite exception are documented.

  • I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

Prepared with Codex.

Summary by CodeRabbit

  • New Features
    • Antigravity connections now configure both desktop settings files, supporting versions 2.15–2.29 and 2.30+ without detecting the installed version.
    • Connection status checks both files and reports connected only when both match the gateway.
    • Disconnect restores each file independently, with recovery support for older restore records and partial failures.
  • Documentation
    • Updated Antigravity integration guides with supported file paths, status behavior, and recovery details.

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Antigravity gateway connector now manages both ~/.gemini/config/config.json and ~/.antigravity/settings.json. It checks both files for status, journals changes per file, and restores files independently. Documentation, GUI copy, and tests cover the updated behavior.

Changes: Antigravity dual-settings integration

Layer / File(s) Summary
Dual-file status and settings contract
src/integrations/gateway-clients/antigravity.ts, src/integrations/gateway-clients/io.ts, src/integrations/gateway-clients/types.ts, structure/clients/antigravity-gateway.md, docs-site/src/content/docs/guides/integrations.md, docs-site/src/content/docs/es/guides/integrations.md, gui/tests/gateway-clients-page.test.tsx, tests/clients/gateway-clients.test.ts
Status includes both settings paths and is connected only when both files match the gateway. Documentation describes which file Antigravity versions read. The GUI test checks that the modern config path appears.
Preflight and connect both files
src/integrations/gateway-clients/antigravity.ts, src/integrations/gateway-clients/types.ts, src/integrations/gateway-clients/io.ts, gui/src/i18n/gateway-clients-copy.ts, docs-site/src/content/docs/guides/integrations.md, docs-site/src/content/docs/es/guides/integrations.md, structure/clients/antigravity-gateway.md, tests/clients/gateway-client-safety.test.ts, tests/cli/gateway-client-command.test.ts, tests/server/gateway-client-routes.test.ts
Connect validates and plans both settings files before writing. It records pending writes, applies the planned settings, and reports changed paths on I/O failure. Tests cover path validation, malformed settings, and both files in connect results.
Per-file restore and recovery
src/integrations/gateway-clients/antigravity.ts, structure/clients/antigravity-gateway.md, tests/clients/gateway-client-restore.test.ts, tests/clients/gateway-client-safety.test.ts, tests/clients/gateway-clients.test.ts, tests/cli/gateway-client-command.test.ts, tests/server/gateway-client-routes.test.ts
Restore records support the earlier single-file format and versioned per-file records. Disconnect restores files independently and retains recovery records for retries after partial failures. Tests cover reconnects, unrelated edits, and restore retries.

Estimated code review effort: 4 (Complex) | ~50 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant Connector as Antigravity connector
  participant Journal as Restore journal
  participant Gemini as Gemini config
  participant Legacy as Antigravity settings
  Connector->>Gemini: Preflight and plan config.json
  Connector->>Legacy: Preflight and plan settings.json
  Connector->>Journal: Save pending per-file records
  Connector->>Gemini: Apply planned settings
  Connector->>Legacy: Apply planned settings
  Connector->>Journal: Save applied per-file records
Loading

Possibly related PRs

  • lidge-jun/opencodex#8742: This PR extends the Antigravity and agy connectors introduced there by adding the modern Gemini settings file and changing restore records.
  • lidge-jun/opencodex#9210: This PR changes the status logic and GUI copy used by the gateway-client status view.
  • lidge-jun/opencodex#8943: Both PRs update Antigravity settings restoration and recovery behavior.
Merge Risk: Minimal · up to 44738

Antigravity gateway settings are now written and checked in both the newer and older config files, and restores are recorded per file. No concrete merge-blocking issue was found. The targeted tests reported by the author cover the changed behavior, and broader CI remains the remaining check.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(integrations): support Antigravity's new gateway config path" matches the main change. The PR makes OpenCodex write and check both ~/.gemini/config/config.json (Antigravity 2.30+) and t…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "fix(integrations): support Antigravity's new gateway config path" matches the main change. The PR makes OpenCodex write and check both ~/.gemini/config/config.json (Antigravity 2.30+) and the legacy ~/.antigravity/settings.json, reports connected only when both match, and adds per-file restore records. The title names the primary change and uses a conventional commit prefix. It is concise, and it does not cover the restore-record redesign, which is acceptable for a title.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 5c350d0 and 4473859.

Files selected for processing: 13

  • docs-site/src/content/docs/es/guides/integrations.md
  • docs-site/src/content/docs/guides/integrations.md
  • gui/src/i18n/gateway-clients-copy.ts
  • gui/tests/gateway-clients-page.test.tsx
  • src/integrations/gateway-clients/antigravity.ts
  • src/integrations/gateway-clients/io.ts
  • src/integrations/gateway-clients/types.ts
  • structure/clients/antigravity-gateway.md
  • tests/cli/gateway-client-command.test.ts
  • tests/clients/gateway-client-restore.test.ts
  • tests/clients/gateway-client-safety.test.ts
  • tests/clients/gateway-clients.test.ts
  • tests/server/gateway-client-routes.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Nov 29, 2026
@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

✅ READY

  • all PR quality gates passed; the review readiness checklist is complete.

Review readiness checklist

  • ✅ Required local validation passed; commands, results, and any full-suite exception are documented.
  • ✅ I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
  • ✅ I resolved all correct Codex and CodeRabbit findings.
  • ✅ My PR is ready for review.

✅ 4/4 boxes ticked.

This pull request is already Ready for Review.
The review-ready label marks this PR as ready; review automation runs independently.
Maintainers: @lidge-jun @Ingwannu

Hygiene

✅ Deterministic PR hygiene checks passed.

@github-actions
github-actions Bot marked this pull request as ready for review November 29, 2026 15:35
Sync upstream dev at 740109d without rewriting the existing PR branch.

Verified on the merged tree with Bun 1.4.4: 176 focused tests passed, typecheck passed, and git diff --check passed.
@github-actions
github-actions Bot marked this pull request as draft November 30, 2026 13:38
@ParsifalC
ParsifalC marked this pull request as ready for review November 30, 2026 15:59
@maxmilneaus

Copy link
Copy Markdown

Confirmed this exact issue live on macOS arm64 (opencodex 2.100.12, Antigravity Desktop 2.36.0):

  • ocx connect antigravity status --json currently reports "state": "connected" from ~/.antigravity/settings.json alone, while ~/.gemini/config/config.json (which 2.36.0 reads) has no gateway block at all.
  • Checked writeClientFile in src/integrations/gateway-clients/io.ts: on macOS, Antigravity 2.36.0 creates ~/.gemini/config/config.json with mode 0600. Updating an existing file preserves 0600 via statSync(target).mode & 0o777; one minor edge case is that creating a brand-new config.json before Antigravity's first run falls back to 0644 (not a blocker given the placeholder key, just worth noting if Antigravity later writes user settings there).

Looking forward to seeing this merged — it directly fixes ocx connect antigravity on Antigravity 2.30+ desktop.

@lidge-jun lidge-jun left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Verified diff on exact head 4d66b25: dual-path Antigravity gateway config support (~/.gemini/config/config.json + legacy settings), backward-compatible restore stashes, confirmed live on macOS; all CI checks green.

@lidge-jun
lidge-jun merged commit 73bca7d into lidge-jun:dev Dec 3, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working review-ready

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants