fix(agent): bound oversized Codex conversations#3567
Merged
richardsolomou merged 5 commits intoJul 20, 2026
Conversation
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
|
😎 Merged manually by @richardsolomou - details. |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
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
charlesvien
approved these changes
Jul 19, 2026
Contributor
|
✅ Visual changes approved by @richardsolomou — baseline updated in 1 changed. |
1 updated Run: 8a2478e8-91ca-4aee-a1c6-ae97445adb6a Co-authored-by: richardsolomou <2622273+richardsolomou@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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?
pnpm --filter @posthog/agent typecheckandpnpm --filter @posthog/agent build.codex-cli 0.144.0, image removal from durable history, and the local-tools MCP server.pnpm install --lockfile-only --frozen-lockfile --ignore-scripts.Automatic notifications
Created with PostHog Code