fix(server): preserve Antigravity startup diagnostics #9839
Closedjuliusmarmingewants to merge 2 commits into
main fromfix/antigravity-validation-diagnosticsopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- @@ -479,4 +480,13 @@479480 : message.startsWith(ANTIGRAVITY_AUTH_BROWSER_MARKER)480481 ? decodeBrowserHelperUrl(message.slice(ANTIGRAVITY_AUTH_BROWSER_MARKER.length))481482 : undefined;482- if (url === undefined) return Effect.void;483+ if (url === undefined) {484+ // Malformed or indented auth messages must not enter installation diagnostics.485+ const trimmed = message.trimStart();486+ if (487+ trimmed.startsWith(ANTIGRAVITY_AUTH_STDOUT_PREFIX) ||488+ trimmed.startsWith(ANTIGRAVITY_AUTH_BROWSER_MARKER)489+ ) {490+ return Effect.void;491+ }492+ return input.onDiagnostic?.(message) ?? Effect.void;
- @@ -490 +491,20 @@490- const initialized = yield* runtime.initialize();491+ onDiagnostic: (message) =>492+ Effect.sync(() => {493+ diagnosticTail = `${diagnosticTail}${message}\n`.slice(494+ -VALIDATION_DIAGNOSTIC_MAX_CHARS,495+ );496+ }),497+ }).pipe(498+ Effect.flatMap((runtime) => runtime.initialize()),499+ Effect.mapError((cause) =>500+ installationError(501+ "verify",502+ [503+ "The downloaded Antigravity runtime could not start in this environment.",504+ diagnosticTail.trim(),505+ ]506+ .filter(Boolean)507+ .join("\n\n"),508+ cause,509+ ),510+ ),@@ -479,4 +480,14 @@479480 : message.startsWith(ANTIGRAVITY_AUTH_BROWSER_MARKER)480481 ? decodeBrowserHelperUrl(message.slice(ANTIGRAVITY_AUTH_BROWSER_MARKER.length))481482 : undefined;482- if (url === undefined) return Effect.void;483+ if (url === undefined) {484+ // Malformed or indented auth messages must not enter installation diagnostics.485+ const trimmed = message.trimStart();486+ if (487+ trimmed.startsWith(ANTIGRAVITY_AUTH_STDOUT_PREFIX) ||488+ trimmed.startsWith(ANTIGRAVITY_AUTH_BROWSER_MARKER)489+ ) {490+ return Effect.void;491+ }492+ return input.onDiagnostic?.(message) ?? Effect.void;493+ }
- apps/server/src/provider/antigravityAuthSupport.ts lines 485 to 491OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -479,4 +480,12 @@479480 : message.startsWith(ANTIGRAVITY_AUTH_BROWSER_MARKER)480481 ? decodeBrowserHelperUrl(message.slice(ANTIGRAVITY_AUTH_BROWSER_MARKER.length))481482 : undefined;482- if (url === undefined) return Effect.void;483+ if (url === undefined) {484+ // Malformed or indented auth messages must not enter installation diagnostics.485+ const trimmed = message.trimStart();486+ if (487+ trimmed.startsWith(ANTIGRAVITY_AUTH_STDOUT_PREFIX) ||488+ trimmed.startsWith(ANTIGRAVITY_AUTH_BROWSER_MARKER)489+ ) {490+ return Effect.void;491+ }
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:M
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
juliusmarminge closed this
Sign in to join this conversation.


macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed