Repository navigation
Description
Description
Codex remote compaction fails in OMP for a ChatGPT Enterprise workspace using EU data residency:
Error: Compaction failed: V2 compaction stream response.failed (data_residency_mismatch): The requested model snapshot is not available for your project's geography. If you need regional processing, consider switching to a model that officially supports it: https://developers.openai.com/api/docs/guides/your-data#which-models-and-features-are-eligible-for-data-residency
This affects both manual /compact and automatic compaction. The same Enterprise subscription and EU-residency setup previously compacted successfully.
The important comparison is transport, not a requested model change:
- OMP V2 compaction directly sends a streaming HTTP/SSE
fetchtohttps://chatgpt.com/backend-api/codex/responses. - Current open-source Codex CLI runs V2 compaction through its model client, which is WebSocket-first and falls back to HTTP only when WebSocket cannot be used.
- I ran a clean, isolated Pi probe with
@howaboua/pi-codex-conversion, whose V2 compactor uses cached WebSocket transport first. It successfully completed a real OpenAI encrypted remote-compaction checkpoint under the same account and EU-residency conditions (48,004 input tokens).
This suggests OMP is taking a materially different backend route from Codex CLI. It is not evidence that EU residency itself must be changed.
Steps to Reproduce
- Sign in to OMP with a ChatGPT Enterprise Codex account whose workspace/project uses EU data residency.
- Use an OpenAI Codex model with remote compaction enabled (the normal/default configuration).
- Build enough conversation context for compaction.
- Run
/compact, or let automatic compaction trigger. - Observe the
data_residency_mismatchfailure above.
Notes from source inspection:
providers.openaiWebsockets: onexists, but does not affect V2 compaction:requestCompactionV2Streaming()directly usesfetch()rather than the WebSocket-capableopenai-codex-responsesprovider.- After V2 fails, OMP attempts the V1 remote endpoint. If remote compaction still fails, current OMP correctly surfaces the native failure rather than silently producing a local summary.
Expected Behavior
OMP should preserve provider-native Codex compaction while following the equivalent transport path where possible:
- Attempt V2 through OMP's existing OpenAI Codex WebSocket provider, preserving live session/sticky-routing state.
- If WebSocket is unavailable or fails, use the existing SSE V2 and then V1 remote fallbacks.
- Surface a classified native error if all remote routes fail; do not silently downgrade to local summarization.
At minimum, the WebSocket preference should either reach V2 compaction or OMP should document that it cannot.
Error Output
Error: Compaction failed: V2 compaction stream response.failed (data_residency_mismatch): The requested model snapshot is not available for your project's geography. If you need regional processing, consider switching to a model that officially supports it: https://developers.openai.com/api/docs/guides/your-data#which-models-and-features-are-eligible-for-data-residencyPlatform
macOS
omp version
omp/17.2.2
Bun version
1.3.14
Provider
ChatGPT Plus/Pro (Codex) — specifically, ChatGPT Enterprise with EU data residency (the template has no Enterprise option).
Area
Session / Compaction
Additional context
Relevant implementation locations in OMP 17.2.2:
packages/agent/src/compaction/compaction-v2-streaming.ts: direct SSEfetch()for V2.packages/agent/src/compaction/compaction.ts: V2 → V1 remote fallback and native-error preservation.packages/ai/src/providers/openai-codex-responses.ts: existing WebSocket-capable Codex provider used by ordinary turns.
Suggested focused tests:
- V2 compaction selects WebSocket when the provider/session supports it.
- WebSocket failure falls back to SSE V2, then V1 remote compaction.
data_residency_mismatchremains a clear terminal remote error when every remote route rejects it.- Manual and automatic compaction share the same classification and never silently switch to local summarization.
No OAuth tokens, account identifiers, or session contents are included here.
Activity
roboomp commentedon Jul 31, 2026
Looking into this; I’ll report back with a focused transport-path reproduction.
roboomp commentedon Jul 31, 2026
Reproduced the transport split with a focused provider probe: an
openai-codex-responsesmodel withpreferWebsockets: truemade 0 WebSocket connections and 1 SSE request throughrequestCompactionV2Streaming(), then surfaced the sameresponse.failed (data_residency_mismatch)error. The bypass is inpackages/agent/src/compaction/compaction-v2-streaming.ts; I’m fixing that path while preserving SSE V2 → V1 fallback.roboomp commentedon Jul 31, 2026
Fixed in #7202. The PR routes Codex V2 compaction through the live WebSocket-first provider session, falls back to SSE V2 on WebSocket transport failure, then retains the existing V1 remote fallback and native-error preservation.
fix(ai): discarded partial websocket compaction replays
fix(ai): preserved turn-state metadata from compaction websockets
fix(agent): routed codex v2 compaction through websockets
fix(ai): discarded partial websocket compaction replays
fix(ai): preserved turn-state metadata from compaction websockets
fix(agent): routed codex v2 compaction through websockets
fix(ai): discarded partial websocket compaction replays
fix(ai): preserved turn-state metadata from compaction websockets