@devries-cameron20 / t3code Mirror · read-only / commits / 2ba4fde9a5
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 07:15 UTC

fix(server): Antigravity 1.5 asks for sign-in when it cannot open a browser (#36037)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

sittingmongoose committed Nov 18, 2026 at 08:26 UTC 2ba4fde9a5578b7ac49f132590ac16f7160324ec
2 files changed +14 -1
apps/server/src/provider/antigravityAuthSupport.test.ts
+8
@@ -275,6 +275,14 @@ describe("Antigravity authorization URL", () => {
275 describe("Antigravity sign-in errors", () => {
276 it("recognizes native auth-required errors and the blocked-login transport error", () => {
277 expect(isAntigravitySignInRequiredError(AcpErrors.AcpRequestError.authRequired())).toBe(true);
278 + // The 1.5 CLI's `authenticate` answer when it has no sign-in and no display to open a browser on.
279 + expect(
280 + isAntigravitySignInRequiredError(
281 + AcpErrors.AcpRequestError.internalError(
282 + "No browser is available here (no graphical display is available to open a browser). Run `agy acp --login` in a terminal on this machine, then retry; or use a Gemini API key.",
283 + ),
284 + ),
285 + ).toBe(true);
286 expect(
287 isAntigravitySignInRequiredError(
288 new AcpErrors.AcpTransportError({
apps/server/src/provider/antigravityAuthSupport.ts
+6 -1
@@ -163,9 +163,14 @@ function authSupportError(detail: string) {
163 return new AcpErrors.AcpTransportError({ detail, cause: undefined });
164 }
165
166 +// The 1.5 CLI answers `authenticate` with this internal error when it has no sign-in and no display.
167 +const NATIVE_CLI_NO_BROWSER_PREFIX = "No browser is available here";
168 +
169 export function isAntigravitySignInRequiredError(error: unknown): boolean {
170 return (
168 - (isAcpRequestError(error) && error.code === -32000) ||
171 + (isAcpRequestError(error) &&
172 + (error.code === -32000 ||
173 + (error.code === -32603 && error.errorMessage.startsWith(NATIVE_CLI_NO_BROWSER_PREFIX)))) ||
174 (isAcpTransportError(error) && error.detail === ANTIGRAVITY_SIGN_IN_REQUIRED_MESSAGE)
175 );
176 }