Skip to content
Source
Sign inSign up
pingdotgg/t3code

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

ClosedMohtashamMurshid(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/11936/headopened View on GitHub

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.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. @@ -0,0 +1,19 @@
      1+import * as Console from "effect/Console";
      2+import { Argument, Command } from "effect/unstable/cli";
      3+
      4+import {
      5+ ANTIGRAVITY_AUTH_BROWSER_MARKER,
      6+ ANTIGRAVITY_BROWSER_HELPER_COMMAND,
      7+} from "../provider/antigravityAuthSupport.ts";
      8+
      9+/**
      10+ * Hosts the no-browser helper inside the single executable. Script installs
      11+ * run the equivalent inline source under Node, while a SEA has no Node
      12+ * interpreter for `-e` and invokes this hidden subcommand instead.
      13+ */
      14+export const antigravityBrowserCommand = Command.make(ANTIGRAVITY_BROWSER_HELPER_COMMAND, {
      15+ url: Argument.string("url"),
      16+}).pipe(
      17+ Command.unlisted,
      18+ Command.withHandler(({ url }) =>
      19+ Console.error(`${ANTIGRAVITY_AUTH_BROWSER_MARKER}${JSON.stringify(url)}`),
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 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.
    3. 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](https://app.macroscope.com/pingdotgg/settings#Repos). You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. 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 3efdcc5296f1754e0f3bf7fee5fc2ada510e0438 and 85976eed196e294d7d983c2ba01976f268ca4316.

      📒 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 nameStatusExplanation
      Title check✅ PassedThe title clearly identifies the server fix and its purpose: supporting Antigravity authentication in standalone binaries.
      Description check✅ PassedThe 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✅ PassedIssue #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✅ PassedThe 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✅ PassedNo 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.
    5. 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).

    6. juliusmarminge closed this

Sign in to join this conversation.