From 58e877b0149b205fcf0f942e591a8d434c56ef5d Mon Sep 17 00:00:00 2001 From: Richard Solomou Date: Sun, 19 Jul 2026 14:09:18 +0300 Subject: [PATCH 1/3] fix(agent): surface oversized Codex requests Reject non-retried 413 responses with recovery guidance instead of ending the turn as a silent refusal. Generated-By: PostHog Code Task-Id: 64d16b4c-2c25-4e05-ba9d-824311186124 --- .../codex-app-server-agent.test.ts | 26 +++++++++++++++++++ .../codex-app-server-agent.ts | 12 +++++++++ 2 files changed, 38 insertions(+) diff --git a/packages/agent/src/adapters/codex-app-server/codex-app-server-agent.test.ts b/packages/agent/src/adapters/codex-app-server/codex-app-server-agent.test.ts index 23355aee71..f77968506e 100644 --- a/packages/agent/src/adapters/codex-app-server/codex-app-server-agent.test.ts +++ b/packages/agent/src/adapters/codex-app-server/codex-app-server-agent.test.ts @@ -1636,6 +1636,32 @@ describe("CodexAppServerAgent", () => { ); }); + it("rejects the prompt with guidance when the gateway request is too large", async () => { + const stub = makeStubRpc({ "thread/start": { thread: { id: "t" } } }); + const { client } = makeFakeClient(); + const agent = new CodexAppServerAgent(client, { + processOptions: { binaryPath: "/x/codex" }, + rpcFactory: stub.factory, + }); + + await agent.newSession({ cwd: "/r" } as unknown as NewSessionRequest); + const done = agent.prompt({ + sessionId: "t", + prompt: [{ type: "text", text: "continue" }], + } as unknown as PromptRequest); + stub.emit("error", { + willRetry: false, + error: { + message: + "unexpected status 413 Payload Too Large: Request body too large", + }, + }); + + await expect(done).rejects.toThrow( + "This conversation is too large to continue", + ); + }); + it("ends the turn without turn/start when no prompt block is usable", async () => { const stub = makeStubRpc({ "thread/start": { thread: { id: "t" } } }); const { client } = makeFakeClient(); diff --git a/packages/agent/src/adapters/codex-app-server/codex-app-server-agent.ts b/packages/agent/src/adapters/codex-app-server/codex-app-server-agent.ts index 8b1ce61b89..ed242424dc 100644 --- a/packages/agent/src/adapters/codex-app-server/codex-app-server-agent.ts +++ b/packages/agent/src/adapters/codex-app-server/codex-app-server-agent.ts @@ -1302,6 +1302,18 @@ export class CodexAppServerAgent extends BaseAcpAgent { this.turns.fail(RequestError.internalError(undefined, message)); return; } + if ( + message.includes("413") || + message.toLowerCase().includes("request body too large") + ) { + this.turns.fail( + RequestError.internalError( + undefined, + "This conversation is too large to continue. Start a new task and carry over a text summary instead of image or tool output.", + ), + ); + return; + } void this.finalizeTurn("refusal"); } } From 012d9ce19ba2825772241674ffedde3389c0d904 Mon Sep 17 00:00:00 2001 From: Richard Solomou Date: Sun, 19 Jul 2026 14:19:58 +0300 Subject: [PATCH 2/3] fix(agent): upgrade Codex image history handling Use a Codex release that prepares image tool output before persisting conversation history, preventing repeated screenshots from growing requests without bound. Generated-By: PostHog Code Task-Id: 64d16b4c-2c25-4e05-ba9d-824311186124 --- apps/code/scripts/download-binaries.mjs | 2 +- packages/agent/package.json | 2 +- pnpm-lock.yaml | 58 ++++++++++++------------- 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/apps/code/scripts/download-binaries.mjs b/apps/code/scripts/download-binaries.mjs index bec564d3ff..28325ade02 100644 --- a/apps/code/scripts/download-binaries.mjs +++ b/apps/code/scripts/download-binaries.mjs @@ -22,7 +22,7 @@ const DEST_DIR = join(__dirname, "..", "resources", "codex-acp"); const BINARIES = [ { name: "codex", - version: "0.140.0", + version: "0.144.0", getUrl: (version, target) => { if (target.includes("windows")) { return `https://github.com/openai/codex/releases/download/rust-v${version}/codex-${target}.exe.zip`; diff --git a/packages/agent/package.json b/packages/agent/package.json index 07804467f5..1ec3a1b8ad 100644 --- a/packages/agent/package.json +++ b/packages/agent/package.json @@ -137,7 +137,7 @@ "@anthropic-ai/claude-agent-sdk": "0.3.197", "@anthropic-ai/sdk": "0.109.0", "@hono/node-server": "^1.19.9", - "@openai/codex": "0.140.0", + "@openai/codex": "0.144.0", "@opentelemetry/api-logs": "^0.208.0", "@opentelemetry/exporter-logs-otlp-http": "^0.208.0", "@opentelemetry/resources": "^2.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 68e8fe7e82..0b9e0f3341 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -719,8 +719,8 @@ importers: specifier: 1.29.0 version: 1.29.0(zod@4.4.3) '@openai/codex': - specifier: 0.140.0 - version: 0.140.0 + specifier: 0.144.0 + version: 0.144.0 '@opentelemetry/api-logs': specifier: ^0.208.0 version: 0.208.0 @@ -4314,43 +4314,43 @@ packages: '@open-draft/until@2.1.0': resolution: {integrity: sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==} - '@openai/codex@0.140.0': - resolution: {integrity: sha512-FMnN12kJzVPljMTYRydLCNgd0cXXmVasNSfq2PtS42RMEIxoQ3dHtMvmno35hu2tfwrKNAAPCm4s+2PaFTEBGg==} + '@openai/codex@0.144.0': + resolution: {integrity: sha512-QFh6f+v5QUx/Vg0HjIl9HB94p7aDLBDkZjc4IXX5RXUcXHPVCZNb6Hl2R49Og/fqW7orgZkeDcgWfRANUa1WoQ==} engines: {node: '>=16'} hasBin: true - '@openai/codex@0.140.0-darwin-arm64': - resolution: {integrity: sha512-KDyQHsxdc8FHZKziSBXs82ABgben/8lLPdhi2Nu+wj6qs2RAp4k/IvE8foafVnp3OeGqhtEFbhlZp0H4Dg/Slg==} + '@openai/codex@0.144.0-darwin-arm64': + resolution: {integrity: sha512-rqFAJdOa2I0VRgepVsSZeLxs96+Y+LXTjccOOvH6894FyaFAYPZ/o+6hgpB1iGHxxdoY/DsGa8jrJC8Leqn9Kg==} engines: {node: '>=16'} cpu: [arm64] os: [darwin] - '@openai/codex@0.140.0-darwin-x64': - resolution: {integrity: sha512-xA77AcKbP8BKxKqaJz8bqXtU1dUtanEKpWCMJ68LuYU054EC31BD7NftFe5/vpLUQR95fhRr7V9a91SLtCuLAg==} + '@openai/codex@0.144.0-darwin-x64': + resolution: {integrity: sha512-4p2jxRbN+Khg5UQzpkzT9upFj+qkEF/abmdvrtflkkWmVKP6Nt+yi8ospdqv9PDqvQ9SotPvX7iXaFaeUTrtmA==} engines: {node: '>=16'} cpu: [x64] os: [darwin] - '@openai/codex@0.140.0-linux-arm64': - resolution: {integrity: sha512-rGOgWEONilm+pQoQgcGpPRzvnou1CawyBOe8gvtuS32PQ00Pn+9nZF4O7iKBVlNh6Jeun8kpdJSjFdULm2wr4A==} + '@openai/codex@0.144.0-linux-arm64': + resolution: {integrity: sha512-k++xhZrn9P3laO00Q92APG6mdOFDD66nUBo+8ExCa1NXi2pjLEMLC4+UNJTUUtUT1PEflOZ5pDKxPXgzaiFFFg==} engines: {node: '>=16'} cpu: [arm64] os: [linux] - '@openai/codex@0.140.0-linux-x64': - resolution: {integrity: sha512-7+N/cHB74nsDkOoL+VQVFVFRlfGj6GFSIAQHgs9DQIsvG+UdzWgUeeDE3l926taJqmzcP9NH8bysptKlZ2Ff6g==} + '@openai/codex@0.144.0-linux-x64': + resolution: {integrity: sha512-GmKtQeX+cO9lN7mQD1FEVcXYEMLMgMByHwZdvlluH0bj/+c2ind3hwbRtE3eECFDekNhEiB80Ez0FfbkyFQqoA==} engines: {node: '>=16'} cpu: [x64] os: [linux] - '@openai/codex@0.140.0-win32-arm64': - resolution: {integrity: sha512-vs5Ed5OF+4671SZoO0MN5WoHl/K9aOSNzLgzbyyDyM7Jwm/PZYvF6OmIPRWf5AGatYqEOWt8Ovp5+df5PFPM7A==} + '@openai/codex@0.144.0-win32-arm64': + resolution: {integrity: sha512-e2yGSgwdzrT1SoJMoOzWD58WBEsIaAMZpEchuV2VGkE2T955SG7dn7EyVQTQcy7/rdpE8aEDktZ/1eQQfjkdtQ==} engines: {node: '>=16'} cpu: [arm64] os: [win32] - '@openai/codex@0.140.0-win32-x64': - resolution: {integrity: sha512-dP+nzd8UQ3Gdby+F5x0Sxd0hu6V9s6/cZYFsGtmmA6eCpU+IIu5tCOnUfgSu5HDw4BvXg046yd8Ihy5bOhwO4A==} + '@openai/codex@0.144.0-win32-x64': + resolution: {integrity: sha512-QiholLCYqNeYvNM77HOmPtrOFrY0rQc/N9nXt+sQGXO3rEGmcWjpLzujY4Oegl3CLRHoieWqlep3EqEvFBjoIA==} engines: {node: '>=16'} cpu: [x64] os: [win32] @@ -19153,31 +19153,31 @@ snapshots: '@open-draft/until@2.1.0': {} - '@openai/codex@0.140.0': + '@openai/codex@0.144.0': optionalDependencies: - '@openai/codex-darwin-arm64': '@openai/codex@0.140.0-darwin-arm64' - '@openai/codex-darwin-x64': '@openai/codex@0.140.0-darwin-x64' - '@openai/codex-linux-arm64': '@openai/codex@0.140.0-linux-arm64' - '@openai/codex-linux-x64': '@openai/codex@0.140.0-linux-x64' - '@openai/codex-win32-arm64': '@openai/codex@0.140.0-win32-arm64' - '@openai/codex-win32-x64': '@openai/codex@0.140.0-win32-x64' + '@openai/codex-darwin-arm64': '@openai/codex@0.144.0-darwin-arm64' + '@openai/codex-darwin-x64': '@openai/codex@0.144.0-darwin-x64' + '@openai/codex-linux-arm64': '@openai/codex@0.144.0-linux-arm64' + '@openai/codex-linux-x64': '@openai/codex@0.144.0-linux-x64' + '@openai/codex-win32-arm64': '@openai/codex@0.144.0-win32-arm64' + '@openai/codex-win32-x64': '@openai/codex@0.144.0-win32-x64' - '@openai/codex@0.140.0-darwin-arm64': + '@openai/codex@0.144.0-darwin-arm64': optional: true - '@openai/codex@0.140.0-darwin-x64': + '@openai/codex@0.144.0-darwin-x64': optional: true - '@openai/codex@0.140.0-linux-arm64': + '@openai/codex@0.144.0-linux-arm64': optional: true - '@openai/codex@0.140.0-linux-x64': + '@openai/codex@0.144.0-linux-x64': optional: true - '@openai/codex@0.140.0-win32-arm64': + '@openai/codex@0.144.0-win32-arm64': optional: true - '@openai/codex@0.140.0-win32-x64': + '@openai/codex@0.144.0-win32-x64': optional: true '@opentelemetry/api-logs@0.208.0': From ee356c973de10281d7621268c8fbd353a1094107 Mon Sep 17 00:00:00 2001 From: "posthog[bot]" <206114724+posthog[bot]@users.noreply.github.com> Date: Mon, 20 Jul 2026 04:16:21 +0000 Subject: [PATCH 3/3] chore(visual): update storybook baselines 1 updated Run: 8a2478e8-91ca-4aee-a1c6-ae97445adb6a Co-authored-by: richardsolomou <2622273+richardsolomou@users.noreply.github.com> --- apps/code/snapshots.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/code/snapshots.yml b/apps/code/snapshots.yml index cfbdd290b1..26cb8c4587 100644 --- a/apps/code/snapshots.yml +++ b/apps/code/snapshots.yml @@ -27,7 +27,7 @@ snapshots: archive-archivedtasksview--many-tasks--dark: hash: v1.k4693efd2.40d24f07a24c6400c32ae68b39fd908a056beb5dc6df8bcb237ec2ab2b494f4a.l2vjfSQDalCPRtDNV7pbfTKGlMsQoI81jI-UdJfLHWE archive-archivedtasksview--many-tasks--light: - hash: v1.k4693efd2.52ec9963bfe6f248ffcdaa4c26945d2b7e303115825b65d978aa5aefd4af1007.ZLtOfTZUrznhYeB-N2SIHzQWRzF6TDSaipNkfd8uzjM + hash: v1.k4693efd2.74c25b303262f2d4c0f22890d351e76f482827548548f7c023bc309327c927b8.DP9VVrvBz1naIJMwHORkfqm69BlO785ulOt4o6zFs94 archive-archivedtasksview--mixed-modes--dark: hash: v1.k4693efd2.d94039b8cc17a4ad1b720364f41fee58a4843aa9a901443997ba62602f698794.441LWZhT-2WQZJHni4LoOgQsOSr2O103NZOk1pF8ME4 archive-archivedtasksview--mixed-modes--light: