Skip to content

fix(server): support Antigravity auth in standalone binary - #11936

Closed
MohtashamMurshid wants to merge 1 commit into
pingdotgg:mainfrom
MohtashamMurshid:fix/antigravity-sea-browser-helper
Closed

MohtashamMurshid wants to merge 1 commit into
pingdotgg:mainfrom
MohtashamMurshid:fix/antigravity-sea-browser-helper

Conversation

@MohtashamMurshid

@MohtashamMurshid MohtashamMurshid commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

The Antigravity profile setup assumes the host executable is Node and invokes it with -e. Standalone T3 binaries reject that flag, so browser suppression preflight fails before any auth method can start.

This adds an unlisted __antigravity-browser command for standalone builds and selects it through HostProcessIsExecutable. Node-based installs keep the existing inline helper. Regression coverage uses a non-Node executable path, and the built Linux SEA was checked for exact marker output and successful EPIPE handling.

Tests: vp test run apps/server/src/provider/antigravityAuthSupport.test.ts apps/server/src/cli/antigravityBrowser.test.ts apps/server/src/bin.test.ts (53 passed)

Fixes #11767

Implemented with GPT-5.6 Sol through the Codex harness in T3 Code.

Summary by CodeRabbit

  • New Features

    • Added support for Antigravity authorization in single-executable deployments.
    • Added a hidden CLI helper to open the authorization browser flow when needed.
  • Bug Fixes

    • Improved authorization setup so browser launching works consistently across executable and script-based installations.
  • Tests

    • Added coverage for the new CLI helper and single-executable authorization behavior.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Sep 15, 2026
}).pipe(
Command.unlisted,
Command.withHandler(({ url }) =>
Console.error(`${ANTIGRAVITY_AUTH_BROWSER_MARKER}${JSON.stringify(url)}`),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Medium cli/antigravityBrowser.ts:19

When Antigravity closes the helper's stderr pipe during browser cancellation, this handler exits nonzero with an unhandled EPIPE instead of completing the suppression flow. Console.error writes directly to the global stderr, but this standalone helper does not install the stderr error handling used by the inline helper; Python therefore treats the command as failed and launches a real browser. Add the same EPIPE handling to the helper's stderr stream before writing the marker.

🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/server/src/cli/antigravityBrowser.ts around line 19:

When Antigravity closes the helper's `stderr` pipe during browser cancellation, this handler exits nonzero with an unhandled `EPIPE` instead of completing the suppression flow. `Console.error` writes directly to the global `stderr`, but this standalone helper does not install the `stderr` error handling used by the inline helper; Python therefore treats the command as failed and launches a real browser. Add the same `EPIPE` handling to the helper's `stderr` stream before writing the marker.

@macroscopeapp

macroscopeapp Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR changes the production Antigravity authentication flow and adds a hidden standalone-binary command that emits OAuth authorization URLs, making it a sensitive authentication-path change. An unresolved Medium finding also reports missing EPIPE handling during browser cancellation, which can alter fallback behavior.

Not approved because:

  • 1 blocking correctness issue found at or above your repo's Minimum Blocking Severity

Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 4eb23830-b7cc-44e9-a4e9-3b7fb9b93e80

📥 Commits

Reviewing files that changed from the base of the PR and between 3efdcc5 and 85976ee.

📒 Files selected for processing (5)
  • apps/server/src/bin.ts
  • apps/server/src/cli/antigravityBrowser.test.ts
  • apps/server/src/cli/antigravityBrowser.ts
  • apps/server/src/provider/antigravityAuthSupport.test.ts
  • apps/server/src/provider/antigravityAuthSupport.ts

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


📝 Walkthrough

Walkthrough

The CLI adds a hidden Antigravity browser helper. Antigravity profile preparation uses this helper when the runtime is a single executable and retains the inline evaluation path for other runtimes. Tests cover both command output and executable preflight invocation.

Changes

Antigravity browser helper

Layer / File(s) Summary
Hidden browser helper command and CLI registration
apps/server/src/cli/antigravityBrowser.ts, apps/server/src/cli/antigravityBrowser.test.ts, apps/server/src/bin.ts
The unlisted command accepts a URL and writes the authorization marker plus the JSON-encoded URL to stderr. The command is registered with the t3 CLI, and its output is tested.
Executable runtime invocation
apps/server/src/provider/antigravityAuthSupport.ts, apps/server/src/provider/antigravityAuthSupport.test.ts
prepareAntigravityProfile selects __antigravity-browser for executable runtimes and retains the -e helper source for other runtimes. The preflight spawn and browser command use the selected arguments. The executable path is tested.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: t3dotgg

Merge Risk: ⚪ Minimal · up to 85976

The standalone executable preflight path is wired to the hidden browser helper while Node installations retain the existing inline path. No actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the server fix and its purpose: supporting Antigravity authentication in standalone binaries.
Description check ✅ Passed The description clearly explains the problem, the implementation, compatibility behavior, regression coverage, test command, and linked issue. It does not use the template headings or include the chec…
Linked Issues check ✅ Passed Issue #11767 requires Antigravity preflight support for standalone T3 executables and compatibility with Node installations. The PR registers the hidden __antigravity-browser command in `apps/server…
Out of Scope Changes check ✅ Passed The changed files implement issue #11767 directly. The CLI command, preflight selection logic, and regression tests support standalone Antigravity browser suppression. No unrelated product behavior or…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 5…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@juliusmarminge

Copy link
Copy Markdown
Member

Closing as superseded by #12033, which fixes the same standalone Antigravity -e / HostProcessExecutablePath preflight failure by resolving a real Node runtime from PATH (Fixes #11767).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Self-contained nightly service breaks Antigravity preflight by invoking t3 with -e

2 participants