Reduce repeated Codex uploads and lossless continuation spill traffic
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 12/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Active
- Tech stack
- bun, typescript
- Domain
- backend, networking
Research direction
The payload names no source files or tests. Start with the upstream WebSocket continuation path that omits an acknowledged input prefix, and find where idle sockets are retired at three minutes and twenty minutes of age. Then find the continuation storage that keeps cumulative records per response ID. Related work is #7806. Done means longer bounded socket retention with lossless compressed spill envelopes, legacy reads still working, and the isolation and cancellation behaviour kept intact.
Written by the indexing model from the issue text.
Description
Area
Streaming; proxy and routing; continuation storage
What are you trying to accomplish?
Keep long-running native Codex sessions from repeatedly uploading the same history, and reduce continuation-cache disk writes without losing replayable context. Ship the behavior upstream so normal package upgrades do not remove locally maintained optimizations.
What prevents this today?
An opt-in upstream WS continuation can already omit an acknowledged, exactly matching input prefix, but the current local extension retires idle sockets after three minutes and by twenty minutes of total age. A later request then uploads the whole history again even when its model, admitted caller, account, thread and route are unchanged.
Local continuation storage also retains cumulative input/output records per response ID. Large repeated records create substantial spill traffic. Merely increasing the cache budget postpones eviction and retains more duplicated data.
What should OpenCodex do?
- Keep completed, eligible connections warm for a bounded longer interval when incremental upload is enabled, without raising socket-count, exchange-count or retained-prefix memory limits.
- Continue only from a completed response belonging to the same admitted caller and unchanged history/envelope. Preserve account/credential/route isolation, cancellation and UNKNOWN/failure behavior.
- Store profitable continuation spill records losslessly in bounded, self-contained compressed envelopes. Preserve legacy reads, original item content, response IDs, thread isolation and decoded-size limits; do not create fragile parent-file dependencies.
- Include this behavior in the supported release path. A local workaround should refuse an incompatible update before replacement rather than silently start an unpatched package.
Example usage or interface
With codexWsIncrementalUpload: true, an isolated test using real Bun WebSockets sends two otherwise equivalent requests with a simulated four-minute idle gap:
| Measurement | Original retention | Longer bounded retention |
|---|---|---|
| First create bytes | 278,631 | 278,631 |
| Second create bytes | 278,751 | 148 |
| Physical connections | 2 | 1 |
| Logical creates | 2 | 2 |
For storage, a bounded read-only sample of eight existing continuation records encoded from 20,913,583 to 14,245,022 bytes (31.9% fewer physical bytes), with exact decoded-content equality. This is a sample, not a promised production reduction. WS JSON savings are not billing savings, whole-interface traffic, or a comparison against compressed HTTP.
Alternatives or workarounds
Local source patches demonstrate the benefit but can be replaced by package upgrades. Blanket history truncation changes the model's context; retaining more raw snapshots increases resource use. Self-contained compression avoids introducing cross-file recovery dependencies. Older readers cannot decode the new envelopes, so rollback must retain the decoder until those records expire.
Additional context
Related implementation: #7806. The follow-up preserves its admitted-caller scoping and live-config binding fixes. Local validation uses synthetic loopback providers and isolated storage; no production prompts, credentials or account identifiers are included.
Checks
- I searched existing issues and documentation.
- This request describes a concrete OpenCodex workflow rather than merely naming a desired technology.
- I removed secrets and personal data.
- Dominant language
- TypeScript
- Stars
- 16.9k
- Forks
- 1.3k
- Avg merge
- 15h 24m
- Merged PRs (30d)
- 678
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lidge-jun/opencodex
-
[Bug]: test home guard treats '..name' children of protected trees as outside themPossibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Opus 5.5: let a client opt into summarized thinking instead of forced progress updatesPossibly taken A pull request linked to this issue is open or already merged. Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
lidge-jun/opencodex#7728 · 1 comment ·
Maintainers usually reply within 1 day
-
account-pool bug
Difficulty 4/5 3-5 days Newbie friendliness 30/100
Maintainers usually reply within 1 day
-
[Bug]: Codex Desktop + Grok 4.7 OAuth returns 400 for output.encrypted_content in includePossibly taken A pull request linked to this issue is open or already merged. Openaccount-pool bug provider
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
bug platform
Difficulty 4/5 Over a week Newbie friendliness 12/100
lidge-jun/opencodex#7872 · 3 comments · 1 reaction ·
Maintainers usually reply within 1 day
All issues in lidge-jun/opencodex
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
gnosis/gnosis_vpn#661 ·
Maintainers usually reply within 1 day
-
content-freshness: staleOwnedContent doc comments still say 'complete receipt' (follow-up to #7912)Opentriage:bug-verified
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
fix: reject sourceStorage/packagedStorage bucket that differs from the stack default (fail loud)Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Eyevinn/open-videocore#1300 ·
Maintainers usually reply within 1 day
-
nextjs-tracking
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
cloudflare/vinext#4390 ·
Maintainers usually reply within 1 day
-
kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
kubernetes-sigs/headlamp#8175 ·
Maintainers usually reply within 2 days