Skip to content
Source
Sign inSign up
pingdotgg/t3code

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

Mergedsittingmongoose(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/36037/headmerged by maria-rcks View on GitHub

Showing 2 changed files with 14 additions and 1 deletion.

x
0 of 2 viewed, 2 left
8 additions and 0 deletionsapps/server/src/provider/antigravityAuthSupport.test.tsModified
View file
@@ -275,6 +275,14 @@
describe("Antigravity sign-in errors", () => {
it("recognizes native auth-required errors and the blocked-login transport error", () => {
expect(isAntigravitySignInRequiredError(AcpErrors.AcpRequestError.authRequired())).toBe(true);
+ // The 1.5 CLI's `authenticate` answer when it has no sign-in and no display to open a browser on.
+ expect(
+ isAntigravitySignInRequiredError(
+ AcpErrors.AcpRequestError.internalError(
+ "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.",
+ ),
+ ),
+ ).toBe(true);
expect(
isAntigravitySignInRequiredError(
new AcpErrors.AcpTransportError({
6 additions and 1 deletionapps/server/src/provider/antigravityAuthSupport.tsModified
View file
@@ -163,9 +163,14 @@
return new AcpErrors.AcpTransportError({ detail, cause: undefined });
​
+// The 1.5 CLI answers `authenticate` with this internal error when it has no sign-in and no display.
+const NATIVE_CLI_NO_BROWSER_PREFIX = "No browser is available here";
+​
export function isAntigravitySignInRequiredError(error: unknown): boolean {
return (
- (isAcpRequestError(error) && error.code === -32000) ||
+ (isAcpRequestError(error) &&