From 33b02bf423a867da7c00070d2b2b1e9dddbbfe54 Mon Sep 17 00:00:00 2001
From: Codex
Date: Sat, 21 Nov 2026 02:38:54 -0600
Subject: [PATCH] fix(antigravity): link to Google account verification from
failed turns
---
.../src/features/threads/thread-work-log.tsx | 18 ++++++-
.../acp/AntigravityTurnOutcome.test.ts | 42 ++++++++++++++++
.../provider/acp/AntigravityTurnOutcome.ts | 49 ++++++++++++++++++-
.../components/chat/TimelineWorkEntryRow.tsx | 21 +++++++-
packages/contracts/src/orchestrationV2.ts | 8 ++-
5 files changed, 134 insertions(+), 4 deletions(-)
diff --git a/apps/mobile/src/features/threads/thread-work-log.tsx b/apps/mobile/src/features/threads/thread-work-log.tsx
index 8f22d0b511651..ea9294dc3e6f0 100644
--- a/apps/mobile/src/features/threads/thread-work-log.tsx
+++ b/apps/mobile/src/features/threads/thread-work-log.tsx
@@ -71,6 +71,7 @@ import { T3Wordmark } from "../../components/T3Wordmark";
import { BrowserAppIcon } from "./BrowserAppIcon";
import { useAppActive, useReduceMotionEnabled } from "../../lib/appState";
import { cn } from "../../lib/cn";
+import { tryOpenExternalUrl } from "../../lib/openExternalUrl";
import { THREAD_WORK_ROW_MIN_HEIGHT, type deriveThreadWorkLogSizing } from "../../lib/layout";
import {
formatItemFullDetail,
@@ -933,7 +934,7 @@ const ThreadWorkLogRow = function ThreadWorkLogRow(
? gt("Usage limit reached. Retry after {resetTime}.", { resetTime })
: gt("Usage limit reached.")
: row.summary;
- return (
+ const errorRow = (
);
+ const verificationUrl = failureItem.failure.verificationUrl;
+ return verificationUrl === undefined ? (
+ errorRow
+ ) : (
+
+ {errorRow}
+
+
+
+ );
}
const notifiedSubagentThreadId =
row.projectedItem.item.type === "notification"
diff --git a/apps/server/src/provider/acp/AntigravityTurnOutcome.test.ts b/apps/server/src/provider/acp/AntigravityTurnOutcome.test.ts
index b6094e638285d..595d145da572a 100644
--- a/apps/server/src/provider/acp/AntigravityTurnOutcome.test.ts
+++ b/apps/server/src/provider/acp/AntigravityTurnOutcome.test.ts
@@ -33,6 +33,28 @@ const RATE_LIMIT_ERROR = errorPayload(
const INVALID_ARGUMENT_ERROR = errorPayload(
"Error 400, Message: Request contains an invalid argument., Status: INVALID_ARGUMENT, Details: []",
);
+const VERIFICATION_URL =
+ "https://accounts.google.com/v3/signin/continue?plt=fixture&flowName=GlifWebSignIn";
+const verificationError = (url: string | undefined) => {
+ const response = {
+ error: {
+ code: 403,
+ details: [
+ {
+ "@type": "type.googleapis.com/google.rpc.ErrorInfo",
+ domain: "cloudcode-pa.googleapis.com",
+ metadata: { validation_url: url },
+ reason: "VALIDATION_REQUIRED",
+ },
+ ],
+ message: "Verify your account to continue.",
+ status: "PERMISSION_DENIED",
+ },
+ };
+ return errorPayload(
+ `Verification Required\u0012PERMISSION_DENIED (code 403): Verify your account to continue.\u001aHTTP 403 Forbidden\n\n${JSON.stringify(response, null, 2)}\n`,
+ );
+};
// Vertex Claude rejects a resumed history whose saved thinking block lost its signature.
const MISSING_SIGNATURE_ERROR = errorPayload(
'Error 400, Message: {"type":"error","error":{"type":"invalid_request_error","message":"messages.1.content.0.thinking.signature: Field required"},"request_id":"req_vrtx_test"}, Status: INVALID_ARGUMENT, Details: []',
@@ -177,6 +199,26 @@ describe("watchAntigravityPromptOutcome", () => {
]))?.failure.retryable,
false,
);
+ for (const url of [
+ VERIFICATION_URL,
+ undefined,
+ "https://accounts.google.com.example.invalid/v3/signin/continue?plt=fixture",
+ ]) {
+ assert.deepEqual(
+ yield* turn([
+ [USER_INPUT, input],
+ [ERROR_MESSAGE, verificationError(url)],
+ ]),
+ reusable({
+ class: "permission_error",
+ message: "Verify your Google account, then retry this turn.",
+ code: "VALIDATION_REQUIRED",
+ retryable: false,
+ ...(url === VERIFICATION_URL ? { verificationUrl: url } : {}),
+ }),
+ );
+ }
+ assert.isUndefined(yield* turn([[PLANNER_RESPONSE, verificationError(VERIFICATION_URL)]]));
// A saved thinking block without a valid signature fails every later prompt.
for (const error of [MISSING_SIGNATURE_ERROR, INVALID_SIGNATURE_ERROR]) {
const outcome = yield* turn([
diff --git a/apps/server/src/provider/acp/AntigravityTurnOutcome.ts b/apps/server/src/provider/acp/AntigravityTurnOutcome.ts
index 32eee40f008ae..c5675254bfa43 100644
--- a/apps/server/src/provider/acp/AntigravityTurnOutcome.ts
+++ b/apps/server/src/provider/acp/AntigravityTurnOutcome.ts
@@ -3,7 +3,10 @@ import * as NodeFSP from "node:fs/promises";
import * as NodePath from "node:path";
import * as NodeSqlite from "node:sqlite";
-import type { OrchestrationV2ProviderFailure } from "@t3tools/contracts";
+import {
+ GoogleAccountVerificationUrl,
+ type OrchestrationV2ProviderFailure,
+} from "@t3tools/contracts";
import { makeProviderFailure } from "@t3tools/provider-core/server/failure";
import * as DateTime from "effect/DateTime";
import * as Effect from "effect/Effect";
@@ -23,6 +26,29 @@ const MAX_ERROR_PAYLOAD_BYTES = 16_384;
const API_ERROR = /Error (\d{3}), Message: (.+?), Status: ([A-Z_]+)/s;
// Antigravity 1.5 with a Google account writes "STATUS (code NNN): message".
const STATUS_ERROR = /(?
+ detail["@type"] === "type.googleapis.com/google.rpc.ErrorInfo" &&
+ detail.domain === "cloudcode-pa.googleapis.com" &&
+ detail.reason === "VALIDATION_REQUIRED",
+ );
+ if (verification !== undefined) {
+ const verificationUrl = Option.getOrUndefined(
+ decodeVerificationUrl(verification.metadata?.validation_url),
+ );
+ return reusable({
+ ...makeProviderFailure({
+ class: "permission_error",
+ message: "Verify your Google account, then retry this turn.",
+ code: "VALIDATION_REQUIRED",
+ retryable: false,
+ }),
+ ...(verificationUrl === undefined ? {} : { verificationUrl }),
+ });
+ }
if (apiError === null) {
return reusable(
makeProviderFailure({
diff --git a/apps/web/src/components/chat/TimelineWorkEntryRow.tsx b/apps/web/src/components/chat/TimelineWorkEntryRow.tsx
index 8e7f03618e59d..936aa770e16f7 100644
--- a/apps/web/src/components/chat/TimelineWorkEntryRow.tsx
+++ b/apps/web/src/components/chat/TimelineWorkEntryRow.tsx
@@ -39,7 +39,13 @@ import type { ExpandedImagePreview } from "./ExpandedImagePreview";
import { workGroupImageGallery } from "./markdownImageGallery";
import { McpSignInAction } from "./McpSignInAction";
import * as DateTime from "effect/DateTime";
-import { ChevronRightIcon, CircleAlertIcon, XIcon, RotateCcwIcon } from "lucide-react";
+import {
+ ChevronRightIcon,
+ CircleAlertIcon,
+ ExternalLinkIcon,
+ XIcon,
+ RotateCcwIcon,
+} from "lucide-react";
import { Button, InlineButton } from "../ui/button";
import { useAssetUrls } from "../../assets/assetUrls";
import { observeResize } from "../../lib/observeResize";
@@ -339,6 +345,7 @@ function WorkEntryLogRow(props: WorkEntryRowProps) {
if (failureItem?.type === "error" && failureItem.status === "failed") {
const warning = failureItem.failure.class === "usage_limit";
const resetAt = failureItem.failure.resetAt;
+ const verificationUrl = failureItem.failure.verificationUrl;
// The reset time is the viewer's local time; naming the zone keeps it
// unambiguous. Both read the zone now, since the device's can change.
const timeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;
@@ -386,6 +393,18 @@ function WorkEntryLogRow(props: WorkEntryRowProps) {
{failureItem.failure.message}
) : null}
+ {verificationUrl !== undefined ? (
+
+ }
+ >
+ Verify Google account
+
+
+
+ ) : null}
{retryRunId !== null && onRetryWorkspacePreparation ? (