[Feature]: Keep a JEV combo on one target per session so provider prompt caches stay warm
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- backend-api-design
Research direction
Start with src/cli/combo.ts to see how combo options are parsed and where the current round-robin-only stickyLimit restriction is enforced. Then trace JEV target selection and the session key derivation, and inspect how decisions are recorded in usage data. Done means an opt-in session pin keeps a successful target for the configured duration or turns, breaks for the listed conditions, and exposes the pin decision while default behavior stays the same.
Written by the indexing model from the issue text.
Description
What are you trying to accomplish?
Keep provider-side prompt caching effective when a strategy: jev combo (jev-auto) is used for long agent sessions. Today JEV re-decides the target on almost every request, so consecutive turns of one conversation land on different providers and each switch starts with a cold prompt cache.
What prevents this today?
- JEV has no notion of session affinity. The only pinning knob,
stickyLimit, is accepted only forstrategy: round-robin(src/cli/combo.ts:--sticky applies only to round-robin). - Related but broader: #6665 (demand-level routing, per-session pinning). This issue is the narrow cache-stability case and can be satisfied by a plain per-session pin.
Observed on a single-operator hub, last 24 h, jev-auto usage ledger (aggregated, no request bodies):
| JEV-selected target | Requests | Input tokens (M) | Cache read / input |
|---|---|---|---|
| anthropic/claude-haiku-5-5 | 635 | 90.7 | 85% |
| google-antigravity/gemini-3.8-flash | 412 | 56.2 | 90% |
| anthropic/claude-sonnet-5-5 | 135 | 21.8 | 78% |
| openai/gpt-6.1-sol | 381 | 36.4 | 23% |
| openai/gpt-5.6-terra | 251 | 17.4 | 18% |
Six different targets appear within a single day. In the OPENCODEX_CACHE_DEBUG=1 fingerprints (171 records, 36 min), the first divergent block is instructions[0] in 117 of 171 records, so consecutive requests from the same client often diverge at the very start of the prefix. Part of that is a separate problem (see "Related observation" below), part is switching targets.
What should OpenCodex do?
- Add a JEV combo option, for example
stickyTurns/sessionPin(default off), that keeps the last successful target for a session key (callerprompt_cache_key, or the existing session derivation) for N turns or T minutes. - Break the pin only on: upstream error or 429 that exhausts retries, the target being removed or disabled, or the request exceeding that target's context window.
- Expose the pin decision in the decision/usage record (
jevDecision.pinned: true,pinReason) so the ledger shows it. - Default behaviour must stay exactly as today.
Example usage or interface
Proposed interface (does not exist today):
ocx combo set jev-auto --strategy jev --session-pin 20m --json
{ "id": "jev-auto", "strategy": "jev", "sessionPin": { "ttlMs": 1200000 } }
Alternatives or workarounds
- Shrink the JEV target list to providers with high cache reuse. Works, but loses the cross-provider escalation JEV exists for.
- Split combos per client so each combo's instructions prefix stays stable. Helps the
instructions[0]divergence, does not fix target churn.
Related observation (separate, for triage)
Direct test through the hub, openai/gpt-6.1-sol, identical ~13.5k-token instructions repeated 3–4 times at 2 s and 20 s spacing, store: false:
- with
prompt_cache_keyforwarded (verifiedinbound == outboundin the cache-debug record):cached_tokens = 0on every request; - without the key:
cached_tokens = 0on every request; - all requests were served by the same pooled account.
So the forwarded key did not produce a hit in this run. It is unclear whether this is expected for pooled ChatGPT-backed accounts, or whether caching only engages for some accounts. Production shows partial OpenAI cache reads (18–33%), which suggests account-dependence. Happy to provide the exact request body and fingerprints on request; no keys included.
Related: #6665, #4546, #6520, #6627, #6481.
- Dominant language
- TypeScript
- Stars
- 16.9k
- Forks
- 1.3k
- Avg merge
- 7h 46m
- Merged PRs (30d)
- 638
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]: Business Premium seat plan self_serve_business_prolite is counted at baseline capacity weight 1 instead of 5Possibly taken A pull request linked to this issue is open or already merged. Openaccount-pool bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
lidge-jun/opencodex#7440 · 2 comments ·
Maintainers usually reply within 1 day
-
[Docs]: translate the #7395 OpenGateway and Mistral provider-guide sectionsPossibly taken @MannXo claimed this 3 days ago. Opendocumentation
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
lidge-jun/opencodex#7405 · 3 comments ·
Maintainers usually reply within 1 day
-
[Bug]: resolveCodexRuntime test depends on the host's installed CodexPossibly taken A pull request linked to this issue is open or already merged. Openbug cli
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
lidge-jun/opencodex#7403 · 2 comments ·
Maintainers usually reply within 1 day
-
account-pool enhancement needs-design proxy
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
lidge-jun/opencodex#6737 · 1 comment ·
Maintainers usually reply within 1 day
-
Codex App hides dictation/voice when model_provider = "opencodex" (desktop 26.1016 capability gate)Openbug proxy
Difficulty 4/5 3-5 days Newbie friendliness 43/100
Maintainers usually reply within 1 day
All issues in lidge-jun/opencodex
Similar issues
-
area:agent-view area:tui bug platform:macos
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
anthropics/claude-code#104558 ·
Maintainers usually reply within 1 day
-
updater
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
UniversityOfHelsinkiCS/oodikone#5141 ·
-
maintanance
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
inmanta/web-console#7606 ·
Maintainers usually reply within 1 day
-
bug skills
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
equinor/fusion-framework#5846 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 74/100