diff --git a/package.json b/package.json index e2c7e1a1a..f2ba92845 100644 --- a/package.json +++ b/package.json @@ -186,7 +186,9 @@ "@buape/carbon@0.0.0-beta-20260109194934": "patches/@buape__carbon@0.0.0-beta-20260109194934.patch", "@mariozechner/pi-agent-core": "patches/@mariozechner__pi-agent-core.patch", "@mariozechner/pi-ai@0.42.1": "patches/@mariozechner__pi-ai@0.42.1.patch", - "@mariozechner/pi-coding-agent": "patches/@mariozechner__pi-coding-agent.patch" + "@mariozechner/pi-coding-agent": "patches/@mariozechner__pi-coding-agent.patch", + "playwright-core@1.57.0": "patches/playwright-core@1.57.0.patch", + "qrcode-terminal": "patches/qrcode-terminal.patch" } }, "vitest": { @@ -220,13 +222,5 @@ "apps/macos/.build/**", "dist/Clawdbot.app/**" ] - }, - "patchedDependencies": { - "@buape/carbon@0.0.0-beta-20260109194934": "patches/@buape__carbon@0.0.0-beta-20260109194934.patch", - "@mariozechner/pi-agent-core": "patches/@mariozechner__pi-agent-core.patch", - "@mariozechner/pi-ai@0.42.1": "patches/@mariozechner__pi-ai@0.42.1.patch", - "@mariozechner/pi-coding-agent": "patches/@mariozechner__pi-coding-agent.patch", - "qrcode-terminal": "patches/qrcode-terminal.patch", - "playwright-core@1.57.0": "patches/playwright-core@1.57.0.patch" } } diff --git a/patches/@buape__carbon.patch b/patches/@buape__carbon.patch deleted file mode 100644 index 5cb5a2353..000000000 --- a/patches/@buape__carbon.patch +++ /dev/null @@ -1,45 +0,0 @@ ---- a/dist/src/classes/RequestClient.js -+++ b/dist/src/classes/RequestClient.js -@@ -86,6 +86,9 @@ - } - } - this.abortController = new AbortController(); -+ const timeoutMs = typeof this.options.timeout === "number" && this.options.timeout > 0 -+ ? this.options.timeout -+ : undefined; - let body; - if (data?.body && - typeof data.body === "object" && -@@ -146,12 +149,26 @@ - body = JSON.stringify(data.body); - } - } -- const response = await fetch(url, { -- method, -- headers, -- body, -- signal: this.abortController.signal -- }); -+ let timeoutId; -+ if (timeoutMs !== undefined) { -+ timeoutId = setTimeout(() => { -+ this.abortController?.abort(); -+ }, timeoutMs); -+ } -+ let response; -+ try { -+ response = await fetch(url, { -+ method, -+ headers, -+ body, -+ signal: this.abortController.signal -+ }); -+ } -+ finally { -+ if (timeoutId) { -+ clearTimeout(timeoutId); -+ } -+ } - if (response.status === 429) { - const responseBody = await response.json(); - const rateLimitError = new RateLimitError(response, responseBody); diff --git a/patches/@mariozechner__pi-ai.patch b/patches/@mariozechner__pi-ai.patch deleted file mode 100644 index 4ca0a2e45..000000000 --- a/patches/@mariozechner__pi-ai.patch +++ /dev/null @@ -1,64 +0,0 @@ -diff --git a/dist/providers/google-gemini-cli.js b/dist/providers/google-gemini-cli.js -index 0000000..1111111 100644 ---- a/dist/providers/google-gemini-cli.js -+++ b/dist/providers/google-gemini-cli.js -@@ -248,6 +248,12 @@ async function* streamGeminiCli(model, context, credentials, options) { - break; // Success, exit retry loop - } - const errorText = await response.text(); -+ // PATCH: Fail immediately on 429 for Antigravity to let caller rotate accounts. -+ // Antigravity rate limits can have very long retry delays (10+ minutes). -+ if (isAntigravity && response.status === 429) { -+ console.log(`[pi-ai] 429 rate limit - failing fast to rotate account`); -+ throw new Error(`Cloud Code Assist API error (${response.status}): ${errorText}`); -+ } - // Check if retryable - if (attempt < MAX_RETRIES && isRetryableError(response.status, errorText)) { - // Use server-provided delay or exponential backoff - -diff --git a/dist/providers/openai-responses.js b/dist/providers/openai-responses.js -index 0000000..1111111 100644 ---- a/dist/providers/openai-responses.js -+++ b/dist/providers/openai-responses.js -@@ -397,9 +397,17 @@ function convertMessages(model, context) { - } - else if (msg.role === "assistant") { - const output = []; -+ // OpenAI Responses rejects `reasoning` items that are not followed by a `message`. -+ // Tool-call-only turns (thinking + function_call) are valid assistant turns, but -+ // their stored reasoning items must not be replayed as standalone `reasoning` input. -+ const hasTextBlock = msg.content.some((b) => b.type === "text"); - for (const block of msg.content) { - // Do not submit thinking blocks if the completion had an error (i.e. abort) - if (block.type === "thinking" && msg.stopReason !== "error") { - if (block.thinkingSignature) { -+ if (!hasTextBlock) -+ continue; - const reasoningItem = JSON.parse(block.thinkingSignature); - output.push(reasoningItem); - } - } - else if (block.type === "text") { - -diff --git a/dist/providers/openai-codex-responses.js b/dist/providers/openai-codex-responses.js -index 0000000..1111111 100644 ---- a/dist/providers/openai-codex-responses.js -+++ b/dist/providers/openai-codex-responses.js -@@ -434,9 +434,17 @@ function convertMessages(model, context) { - } - else if (msg.role === "assistant") { - const output = []; -+ // OpenAI Responses rejects `reasoning` items that are not followed by a `message`. -+ // Tool-call-only turns (thinking + function_call) are valid assistant turns, but -+ // their stored reasoning items must not be replayed as standalone `reasoning` input. -+ const hasTextBlock = msg.content.some((b) => b.type === "text"); - for (const block of msg.content) { - if (block.type === "thinking" && msg.stopReason !== "error") { - if (block.thinkingSignature) { -+ if (!hasTextBlock) -+ continue; - const reasoningItem = JSON.parse(block.thinkingSignature); - output.push(reasoningItem); - } - } - else if (block.type === "text") { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 961facf9c..b58e0a206 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,6 +20,12 @@ patchedDependencies: '@mariozechner/pi-coding-agent': hash: 58af7c712ebe270527c2ad9d3351fac39d6cd4b81cc475a258d87840b446b90e path: patches/@mariozechner__pi-coding-agent.patch + 'playwright-core@1.57.0': + hash: 66f1f266424dbe354068aaa5bba87bfb0e1d7d834a938c25dd70d43cdf1c1b02 + path: patches/playwright-core@1.57.0.patch + qrcode-terminal: + hash: ed82029850dbdf551f5df1de320945af52b8ea8500cc7bd4f39258e7a3d92e12 + path: patches/qrcode-terminal.patch importers: