Skip to content

fix(agent): bound oversized Codex conversations#3567

Merged
richardsolomou merged 5 commits into
mainfrom
posthog-code/fix/codex-large-request-errors
Jul 20, 2026
Merged

fix(agent): bound oversized Codex conversations#3567
richardsolomou merged 5 commits into
mainfrom
posthog-code/fix/codex-large-request-errors

Conversation

@richardsolomou

@richardsolomou richardsolomou commented Jul 19, 2026

Copy link
Copy Markdown
Member

Problem

Image-heavy Codex conversations can exceed the gateway request limit. The turn then ends silently because the adapter treats the fatal 413 response as a refusal.

Changes

I surface request-size failures with a recovery path. I also upgrade Codex to 0.144.0, which prepares image tool output before durable history persistence so screenshots do not grow every later request.

How did you test this?

  • Ran the Codex app-server adapter test suite.
  • Ran pnpm --filter @posthog/agent typecheck and pnpm --filter @posthog/agent build.
  • Verified codex-cli 0.144.0, image removal from durable history, and the local-tools MCP server.
  • Ran pnpm install --lockfile-only --frozen-lockfile --ignore-scripts.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

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
@trunk-io

trunk-io Bot commented Jul 19, 2026

Copy link
Copy Markdown

😎 Merged manually by @richardsolomou - details.

@github-actions

github-actions Bot commented Jul 19, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 91d7f9f.

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
@richardsolomou richardsolomou changed the title fix(agent): surface oversized Codex requests fix(agent): bound oversized Codex conversations Jul 19, 2026
@richardsolomou
richardsolomou requested a review from a team July 19, 2026 12:16
@posthog

posthog Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Visual changes approved by @richardsolomou — baseline updated in ee356c9.

View this run in PostHog

1 changed.

posthog Bot and others added 2 commits July 20, 2026 04:16
1 updated
Run: 8a2478e8-91ca-4aee-a1c6-ae97445adb6a

Co-authored-by: richardsolomou <2622273+richardsolomou@users.noreply.github.com>
@richardsolomou
richardsolomou merged commit 204f6f0 into main Jul 20, 2026
30 of 32 checks passed
@richardsolomou
richardsolomou deleted the posthog-code/fix/codex-large-request-errors branch July 20, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants