fix(antigravity): forward Google sign-in URLs from browser helper #9425
MergedWellyngtonF(GitHub profile, opens in a new tab)merged 4 commits into
main fromrefs/pull/9425/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- apps/server/src/provider/acp/AntigravityAcpSupport.ts line 78Resolvedby WellyngtonF(GitHub profile, opens in a new tab)@@ -73,4 +73,6 @@7373 transformStdout: makeAntigravityStdoutTransform(7474 input.onAuthorizationUrl ? { onAuthorizationUrl: input.onAuthorizationUrl } : {},7575 ),76- onStderr: drainAntigravityStderr,76+ ...(input.onAuthorizationUrl77+ ? {78+ onStderr: makeAntigravityStderrHandler({
- apps/server/src/provider/antigravityAuthSupport.ts line 479Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -458,2 +461,19 @@458-/** Upstream stderr can contain OAuth URLs, states, and redirect codes. */459-export const drainAntigravityStderr = (_text: string): Effect.Effect<void> => Effect.void;461+/** Receives the URL emitted by T3's no-browser helper on stderr. */462+export function makeAntigravityStderrHandler(input: {463+ readonly onAuthorizationUrl: (464+ authorizationUrl: string,465+ ) => Effect.Effect<void, AcpErrors.AcpError>;466+}) {467+ let pending = "";468+ const handleLine = (line: string) => {469+ const message = line.endsWith("\r") ? line.slice(0, -1) : line;470+ if (471+ message.length > maxBrowserHelperLineLength ||472+ !message.startsWith(ANTIGRAVITY_AUTH_BROWSER_MARKER)473+ ) {474+ return Effect.void;475+ }476+ return decodeBrowserHelperUrl(message.slice(ANTIGRAVITY_AUTH_BROWSER_MARKER.length)).pipe(477+ Effect.flatMap(parseAntigravityAuthorizationUrl),478+ Effect.flatMap((request) => input.onAuthorizationUrl(request.authorizationUrl)),479+ Effect.ignore,
- apps/server/src/provider/AntigravityAuth.ts line 242OutdatedResolvedby WellyngtonF(GitHub profile, opens in a new tab)@@ -239,3 +239,4 @@239239 Effect.gen(function* () {240240 if (activeFlow !== flow || operation !== "auth") return;241241 if (flow.pending) {242+ if (flow.state.authorizationUrl === authorization.authorizationUrl) return;
t3dotgg(GitHub profile, opens in a new tab) approved these changes
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.


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