Skip to content

fix(proxy): use Responses stream compaction for Codex accounts - #1719

Draft
onlysdesign-ui wants to merge 6 commits into
Soju06:mainfrom
onlysdesign-ui:agent/responses-stream-compaction-v2
Draft

fix(proxy): use Responses stream compaction for Codex accounts#1719
onlysdesign-ui wants to merge 6 commits into
Soju06:mainfrom
onlysdesign-ui:agent/responses-stream-compaction-v2

Conversation

@onlysdesign-ui

Copy link
Copy Markdown
Contributor

Summary

  • use the current Responses streaming contract for account-scoped Codex compaction
  • append exactly one compaction_trigger, collect one compaction output item plus response.completed, and preserve encrypted content, item ID, and status
  • retain the legacy /responses/compact endpoint only as a 404/405/501 compatibility fallback

Root cause

Codex Desktop's remote compaction path now uses POST /codex/responses with a terminal compaction_trigger. The proxy sent account-scoped compaction only to the legacy JSON endpoint, which returned upstream 404; oversized threads then continued until context_length_exceeded.

Validation

  • 31 passedtests/unit/test_codex_upstream_paths.py
  • ruff check passed for changed Python files
  • git diff --check passed
  • strict OpenSpec validation passed for restore-responses-compaction-v2
  • local installed runtime was backed up, synchronized, restarted, and real /backend-api/codex/responses/compact returned HTTP 200 with a preserved compaction item

Fixes the current Codex compaction compatibility regression without disabling compaction.

@Komzpa
Komzpa force-pushed the agent/responses-stream-compaction-v2 branch from 910cd41 to e976e5b Compare August 13, 2026 20:22
@Komzpa

Komzpa commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f70f910ed7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/modules/proxy/_service/compact.py Outdated
Comment thread app/core/clients/proxy.py
Comment thread app/core/clients/proxy.py
Comment thread app/core/clients/proxy.py
Comment thread app/core/clients/proxy.py
@Komzpa Komzpa added the 🤖 codex: needs work [@codex review] raised an issue label Aug 13, 2026
@Komzpa
Komzpa force-pushed the agent/responses-stream-compaction-v2 branch 2 times, most recently from 060ca5b to ecb89c1 Compare August 14, 2026 09:06
@Komzpa
Komzpa force-pushed the agent/responses-stream-compaction-v2 branch from ecb89c1 to 06423d1 Compare August 14, 2026 09:08
@Komzpa

Komzpa commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 06423d1ef4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/core/clients/proxy.py
Comment thread app/core/clients/proxy.py Outdated
Comment thread app/core/clients/proxy.py
Comment thread app/core/clients/proxy.py
Comment thread app/core/clients/proxy.py
@Komzpa Komzpa removed the 🤖 codex: needs work [@codex review] raised an issue label Aug 14, 2026
@Komzpa

Komzpa commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bddd20c8ce

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/core/clients/proxy.py
Comment thread app/core/clients/proxy.py
Comment thread app/core/clients/proxy.py
@Komzpa Komzpa added the 🤖 codex: needs work [@codex review] raised an issue label Aug 14, 2026
@Komzpa Komzpa removed the 🤖 codex: needs work [@codex review] raised an issue label Aug 15, 2026
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