Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion apps/mobile/src/features/threads/thread-work-log.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 = (
<WorkLogPressable
accessibilityLabel={
warning
Expand Down Expand Up @@ -997,6 +998,22 @@ const ThreadWorkLogRow = function ThreadWorkLogRow(
</View>
</WorkLogPressable>
);
const verificationUrl = failureItem.failure.verificationUrl;
return verificationUrl === undefined ? (
errorRow
) : (
<View>
{errorRow}
<View className="ml-7 mt-1.5 pb-1">
<Button
label={gt("Verify Google account")}
size="compact"
tone="secondary"
onPress={() => void tryOpenExternalUrl(verificationUrl, "provider-auth")}
/>
</View>
</View>
);
}
const notifiedSubagentThreadId =
row.projectedItem.item.type === "notification"
Expand Down
3 changes: 2 additions & 1 deletion apps/mobile/src/i18n/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -5613,5 +5613,6 @@
"856812e7e1fc445e": "Tool-Aufrufe im Chat",
"8d545d54c0a9e950": "Die Befehle, Bearbeitungen und Suchen ausblenden, die Agenten ausführen. „Erfolgreiche ausblenden“ behält Fehler. „Zen“ zeigt nur endgültige Antworten. Genehmigungen, Fragen und Fehler werden immer angezeigt.",
"99d51127f573296b": "Weiteres Konto",
"8ec2c57414669b79": "Verbinde einen zweiten {tracker}-Workspace oder -Nutzer."
"8ec2c57414669b79": "Verbinde einen zweiten {tracker}-Workspace oder -Nutzer.",
"1a1beecff68a6e61": "Google-Konto bestätigen"
}
3 changes: 2 additions & 1 deletion apps/mobile/src/i18n/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -5615,5 +5615,6 @@
"856812e7e1fc445e": "Tool calls in chat",
"8d545d54c0a9e950": "Hide the commands, edits, and searches agents run. Hide successful keeps failures. Zen shows only final answers. Approvals, questions, and errors always show.",
"99d51127f573296b": "Another account",
"8ec2c57414669b79": "Connect a second {tracker} workspace or user."
"8ec2c57414669b79": "Connect a second {tracker} workspace or user.",
"1a1beecff68a6e61": "Verify Google account"
}
3 changes: 2 additions & 1 deletion apps/mobile/src/i18n/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -5607,5 +5607,6 @@
"856812e7e1fc445e": "Llamadas a herramientas en el chat",
"8d545d54c0a9e950": "Oculta los comandos, ediciones y búsquedas que ejecutan los agentes. Ocultar las correctas mantiene los fallos. Zen solo muestra las respuestas finales. Las aprobaciones, preguntas y errores siempre se muestran.",
"99d51127f573296b": "Otra cuenta",
"8ec2c57414669b79": "Conecta un segundo espacio de trabajo o usuario de {tracker}."
"8ec2c57414669b79": "Conecta un segundo espacio de trabajo o usuario de {tracker}.",
"1a1beecff68a6e61": "Verificar cuenta de Google"
}
3 changes: 2 additions & 1 deletion apps/mobile/src/i18n/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -5607,5 +5607,6 @@
"856812e7e1fc445e": "Appels d’outils dans la discussion",
"8d545d54c0a9e950": "Masque les commandes, modifications et recherches lancées par les agents. Masquer les réussis garde les échecs. Zen n’affiche que les réponses finales. Les approbations, questions et erreurs s’affichent toujours.",
"99d51127f573296b": "Autre compte",
"8ec2c57414669b79": "Connectez un second espace de travail ou utilisateur {tracker}."
"8ec2c57414669b79": "Connectez un second espace de travail ou utilisateur {tracker}.",
"1a1beecff68a6e61": "Vérifier le compte Google"
}
3 changes: 2 additions & 1 deletion apps/mobile/src/i18n/translations/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -5587,5 +5587,6 @@
"856812e7e1fc445e": "チャット内のツール呼び出し",
"8d545d54c0a9e950": "エージェントが実行するコマンド、編集、検索を非表示にします。「成功したものを非表示」では失敗は表示されます。Zen では最終的な回答だけを表示します。承認、質問、エラーは常に表示されます。",
"99d51127f573296b": "別のアカウント",
"8ec2c57414669b79": "2つ目の {tracker} ワークスペースまたはユーザーを接続します。"
"8ec2c57414669b79": "2つ目の {tracker} ワークスペースまたはユーザーを接続します。",
"1a1beecff68a6e61": "Google アカウントを確認"
}
3 changes: 2 additions & 1 deletion apps/mobile/src/i18n/translations/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -5593,5 +5593,6 @@
"856812e7e1fc445e": "채팅의 도구 호출",
"8d545d54c0a9e950": "에이전트가 실행하는 명령, 편집, 검색을 숨깁니다. 성공한 항목 숨기기는 실패를 남겨 둡니다. Zen은 최종 답변만 표시합니다. 승인, 질문, 오류는 항상 표시됩니다.",
"99d51127f573296b": "다른 계정",
"8ec2c57414669b79": "두 번째 {tracker} 워크스페이스 또는 사용자를 연결합니다."
"8ec2c57414669b79": "두 번째 {tracker} 워크스페이스 또는 사용자를 연결합니다.",
"1a1beecff68a6e61": "Google 계정 확인"
}
3 changes: 2 additions & 1 deletion apps/mobile/src/i18n/translations/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -5607,5 +5607,6 @@
"856812e7e1fc445e": "Chamadas de ferramentas no chat",
"8d545d54c0a9e950": "Oculta os comandos, edições e pesquisas que os agentes executam. \"Ocultar bem-sucedidas\" mantém as falhas. Zen mostra só as respostas finais. Aprovações, perguntas e erros sempre aparecem.",
"99d51127f573296b": "Outra conta",
"8ec2c57414669b79": "Conecte um segundo espaço de trabalho ou usuário do {tracker}."
"8ec2c57414669b79": "Conecte um segundo espaço de trabalho ou usuário do {tracker}.",
"1a1beecff68a6e61": "Verificar conta Google"
}
3 changes: 2 additions & 1 deletion apps/mobile/src/i18n/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -5687,5 +5687,6 @@
"856812e7e1fc445e": "Вызовы инструментов в чате",
"8d545d54c0a9e950": "Скрывать команды, правки и поиски, которые выполняют агенты. «Скрывать успешные» оставляет ошибки. «Дзен» показывает только итоговые ответы. Запросы подтверждения, вопросы и ошибки показываются всегда.",
"99d51127f573296b": "Другой аккаунт",
"8ec2c57414669b79": "Подключите второе рабочее пространство или пользователя {tracker}."
"8ec2c57414669b79": "Подключите второе рабочее пространство или пользователя {tracker}.",
"1a1beecff68a6e61": "Подтвердить аккаунт Google"
}
3 changes: 2 additions & 1 deletion apps/mobile/src/i18n/translations/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -5613,5 +5613,6 @@
"856812e7e1fc445e": "Verktygsanrop i chatten",
"8d545d54c0a9e950": "Dölj kommandon, redigeringar och sökningar som agenter kör. Dölj lyckade behåller misslyckanden. Zen visar bara slutliga svar. Godkännanden, frågor och fel visas alltid.",
"99d51127f573296b": "Ett konto till",
"8ec2c57414669b79": "Anslut en andra {tracker}-arbetsyta eller användare."
"8ec2c57414669b79": "Anslut en andra {tracker}-arbetsyta eller användare.",
"1a1beecff68a6e61": "Verifiera Google-konto"
}
3 changes: 2 additions & 1 deletion apps/mobile/src/i18n/translations/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -5597,5 +5597,6 @@
"856812e7e1fc445e": "聊天中的工具调用",
"8d545d54c0a9e950": "隐藏智能体执行的命令、编辑和搜索。“隐藏成功的调用”仍保留失败项;“专注模式”仅显示最终回答。审批、提问和错误始终显示。",
"99d51127f573296b": "其他账号",
"8ec2c57414669b79": "连接第二个 {tracker} 工作区或用户。"
"8ec2c57414669b79": "连接第二个 {tracker} 工作区或用户。",
"1a1beecff68a6e61": "验证 Google 账户"
}
54 changes: 54 additions & 0 deletions apps/server/src/provider/acp/AntigravityTurnOutcome.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,32 @@ const BAD_GATEWAY_ERROR = Buffer.concat([
),
Buffer.from("\nThe model is currently unreachable."),
]);
const VERIFICATION_URL =
"https://accounts.google.com/v3/signin/continue?plt=fixture&flowName=GlifWebSignIn";
const CLASSIC_VERIFICATION_URL =
"https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=fixture&flowName=GlifWebSignIn";
const verificationError = (url: string | undefined, compact = false) => {
const response = {
error: {
code: 403,
details: [
{ "@type": "type.googleapis.com/google.rpc.Help", links: [] },
{
"@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",
},
};
const body = compact ? JSON.stringify(response) : JSON.stringify(response, null, 2);
return errorPayload(
`Verification Required\u0012PERMISSION_DENIED (code 403): Verify your account to continue.\u001aHTTP 403 Forbidden\n\n${body}\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: []',
Expand Down Expand Up @@ -222,6 +248,34 @@ describe("watchAntigravityPromptOutcome", () => {
]))?.failure.retryable,
false,
);
// Google account verification errors surface the verified continuation link on both
// pretty-printed and compact HTTP bodies, while rejecting untrusted or malformed URLs.
for (const [url, compact, accepted] of [
[VERIFICATION_URL, false, true],
[CLASSIC_VERIFICATION_URL, true, true],
[undefined, false, false],
[
"https://accounts.google.com.example.invalid/v3/signin/continue?plt=fixture",
false,
false,
],
["https://accounts.google.com/v3/signin/continue?plt=fixture\u0007", false, false],
] as const) {
assert.deepEqual(
yield* turn([
[USER_INPUT, input],
[ERROR_MESSAGE, verificationError(url, compact)],
]),
reusable({
class: "permission_error",
message: "Verify your Google account, then retry this turn.",
code: "VALIDATION_REQUIRED",
retryable: false,
...(accepted && url !== undefined ? { 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([
Expand Down
77 changes: 77 additions & 0 deletions apps/server/src/provider/acp/AntigravityTurnOutcome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,29 @@ const API_ERROR =
/Error (\d{3}), Message: ((?:(?!, Status: |Error \d{3}, Message: ).)+), Status: ([A-Z_]+|\d{3}[^,\n]*)/s;
// Antigravity 1.5 with a Google account writes "STATUS (code NNN): message".
const STATUS_ERROR = /(?<![A-Z_])([A-Z_]+) \(code (\d{3})\): (\P{Cc}+)/u;
// Newer Antigravity builds attach the HTTP JSON body (pretty-printed or compact) to the error step.
const ERROR_JSON_START = /\{\s*"error"\s*:/g;
const decodeVerificationError = Schema.decodeUnknownOption(
Schema.fromJsonString(
Schema.Struct({
error: Schema.Struct({
code: Schema.Literal(403),
status: Schema.Literal("PERMISSION_DENIED"),
details: Schema.Array(Schema.Unknown),
}),
}),
),
);
const decodeVerificationErrorInfo = Schema.decodeUnknownOption(
Schema.Struct({
"@type": Schema.Literal("type.googleapis.com/google.rpc.ErrorInfo"),
domain: Schema.Literal("cloudcode-pa.googleapis.com"),
reason: Schema.Literal("VALIDATION_REQUIRED"),
metadata: Schema.optionalKey(
Schema.NullOr(Schema.Struct({ validation_url: Schema.optionalKey(Schema.Unknown) })),
),
}),
);
const QUOTA_EXHAUSTED = /\breason:QUOTA_EXHAUSTED\b/;
// Claude rejects a saved thinking block without a valid signature. It sits in the native
// history, so every later prompt to that session fails the same way.
Expand Down Expand Up @@ -128,6 +151,48 @@ function statusError(text: string) {
return match === null ? null : ([match[0], match[2], match[3], match[1]] as const);
}

function balancedJsonObject(text: string, start: number): string | undefined {
let depth = 0;
let inString = false;
let escaped = false;
for (let i = start; i < text.length; i += 1) {
const ch = text[i];
if (inString) {
if (escaped) {
escaped = false;
} else if (ch === "\\") {
escaped = true;
} else if (ch === '"') {
inString = false;
}
continue;
}
if (ch === '"') {
inString = true;
} else if (ch === "{") {
depth += 1;
} else if (ch === "}") {
depth -= 1;
if (depth === 0) return text.slice(start, i + 1);
}
}
return undefined;
}

function verificationErrorInfo(text: string) {
for (const match of text.matchAll(ERROR_JSON_START)) {
const json = balancedJsonObject(text, match.index);
if (json === undefined) continue;
const response = Option.getOrUndefined(decodeVerificationError(json));
if (response === undefined) continue;
for (const detail of response.error.details) {
const info = Option.getOrUndefined(decodeVerificationErrorInfo(detail));
if (info !== undefined) return info;
}
}
return undefined;
}

function turnFailure(
stopReason: EffectAcpSchema.StopReason,
step: LastStep | undefined,
Expand Down Expand Up @@ -172,6 +237,18 @@ function turnFailure(
threadDisposition: "broken",
};
}
const verification = verificationErrorInfo(text);
if (verification !== undefined) {
return reusable(
makeProviderFailure({
class: "permission_error",
message: "Verify your Google account, then retry this turn.",
code: "VALIDATION_REQUIRED",
retryable: false,
verificationUrl: verification.metadata?.validation_url,
}),
);
}
if (apiError === null) {
return reusable(
makeProviderFailure({
Expand Down
21 changes: 20 additions & 1 deletion apps/web/src/components/chat/TimelineWorkEntryRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -386,6 +393,18 @@ function WorkEntryLogRow(props: WorkEntryRowProps) {
{failureItem.failure.message}
</p>
) : null}
{verificationUrl !== undefined ? (
<div className="ms-7 pb-1">
<Button
size="xs"
variant="outline"
render={<a href={verificationUrl} target="_blank" rel="noopener noreferrer" />}
>
<T>Verify Google account</T>
<ExternalLinkIcon aria-hidden />
</Button>
</div>
) : null}
{retryRunId !== null && onRetryWorkspacePreparation ? (
<div className="ms-7 pb-1">
<Button
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/i18n/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -12781,5 +12781,6 @@
"99d51127f573296b": "Weiteres Konto",
"8ec2c57414669b79": "Verbinde einen zweiten {tracker}-Workspace oder -Nutzer.",
"99963c0142e17f00": "Für das neue {tracker}-Konto.",
"6d8e4ebc889bace9": "Konto hinzufügen"
"6d8e4ebc889bace9": "Konto hinzufügen",
"91aadfc843c600de": "Google-Konto bestätigen"
}
3 changes: 2 additions & 1 deletion apps/web/src/i18n/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -12790,5 +12790,6 @@
"99d51127f573296b": "Another account",
"8ec2c57414669b79": "Connect a second {tracker} workspace or user.",
"99963c0142e17f00": "For the new {tracker} account.",
"6d8e4ebc889bace9": "Add account"
"6d8e4ebc889bace9": "Add account",
"91aadfc843c600de": "Verify Google account"
}
3 changes: 2 additions & 1 deletion apps/web/src/i18n/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -12776,5 +12776,6 @@
"99d51127f573296b": "Otra cuenta",
"8ec2c57414669b79": "Conecta un segundo espacio de trabajo o usuario de {tracker}.",
"99963c0142e17f00": "Para la nueva cuenta de {tracker}.",
"6d8e4ebc889bace9": "Añadir cuenta"
"6d8e4ebc889bace9": "Añadir cuenta",
"91aadfc843c600de": "Verificar cuenta de Google"
}
3 changes: 2 additions & 1 deletion apps/web/src/i18n/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -12781,5 +12781,6 @@
"99d51127f573296b": "Autre compte",
"8ec2c57414669b79": "Connectez un second espace de travail ou utilisateur {tracker}.",
"99963c0142e17f00": "Pour le nouveau compte {tracker}.",
"6d8e4ebc889bace9": "Ajouter un compte"
"6d8e4ebc889bace9": "Ajouter un compte",
"91aadfc843c600de": "Vérifier le compte Google"
}
3 changes: 2 additions & 1 deletion apps/web/src/i18n/translations/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -12722,5 +12722,6 @@
"99d51127f573296b": "別のアカウント",
"8ec2c57414669b79": "2つ目の {tracker} ワークスペースまたはユーザーを接続します。",
"99963c0142e17f00": "新しい {tracker} アカウント用です。",
"6d8e4ebc889bace9": "アカウントを追加"
"6d8e4ebc889bace9": "アカウントを追加",
"91aadfc843c600de": "Google アカウントを確認"
}
3 changes: 2 additions & 1 deletion apps/web/src/i18n/translations/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -12718,5 +12718,6 @@
"99d51127f573296b": "다른 계정",
"8ec2c57414669b79": "두 번째 {tracker} 워크스페이스 또는 사용자를 연결합니다.",
"99963c0142e17f00": "새 {tracker} 계정용입니다.",
"6d8e4ebc889bace9": "계정 추가"
"6d8e4ebc889bace9": "계정 추가",
"91aadfc843c600de": "Google 계정 확인"
}
3 changes: 2 additions & 1 deletion apps/web/src/i18n/translations/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -12781,5 +12781,6 @@
"99d51127f573296b": "Outra conta",
"8ec2c57414669b79": "Conecte um segundo espaço de trabalho ou usuário do {tracker}.",
"99963c0142e17f00": "Para a nova conta do {tracker}.",
"6d8e4ebc889bace9": "Adicionar conta"
"6d8e4ebc889bace9": "Adicionar conta",
"91aadfc843c600de": "Verificar conta Google"
}
3 changes: 2 additions & 1 deletion apps/web/src/i18n/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -12781,5 +12781,6 @@
"99d51127f573296b": "Другой аккаунт",
"8ec2c57414669b79": "Подключите второе рабочее пространство или пользователя {tracker}.",
"99963c0142e17f00": "Для нового аккаунта {tracker}.",
"6d8e4ebc889bace9": "Добавить аккаунт"
"6d8e4ebc889bace9": "Добавить аккаунт",
"91aadfc843c600de": "Подтвердить аккаунт Google"
}
3 changes: 2 additions & 1 deletion apps/web/src/i18n/translations/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -12788,5 +12788,6 @@
"99d51127f573296b": "Ett konto till",
"8ec2c57414669b79": "Anslut en andra {tracker}-arbetsyta eller användare.",
"99963c0142e17f00": "För det nya {tracker}-kontot.",
"6d8e4ebc889bace9": "Lägg till konto"
"6d8e4ebc889bace9": "Lägg till konto",
"91aadfc843c600de": "Verifiera Google-konto"
}
Loading
Loading