Skip to content
Merged
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
2 changes: 1 addition & 1 deletion apps/code/scripts/download-binaries.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand Down
2 changes: 1 addition & 1 deletion apps/code/snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion packages/agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
"@anthropic-ai/sdk": "0.109.0",
"@earendil-works/pi-coding-agent": "catalog:",
"@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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
Expand Down
58 changes: 29 additions & 29 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading