Skip to content

Codex V2 remote compaction uses SSE while WebSocket-first native compaction succeeds with Enterprise EU residency #7198

Closed

Description

@a-glapinski

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 fetch to https://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

  1. Sign in to OMP with a ChatGPT Enterprise Codex account whose workspace/project uses EU data residency.
  2. Use an OpenAI Codex model with remote compaction enabled (the normal/default configuration).
  3. Build enough conversation context for compaction.
  4. Run /compact, or let automatic compaction trigger.
  5. Observe the data_residency_mismatch failure above.

Notes from source inspection:

  1. providers.openaiWebsockets: on exists, but does not affect V2 compaction: requestCompactionV2Streaming() directly uses fetch() rather than the WebSocket-capable openai-codex-responses provider.
  2. 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:

  1. Attempt V2 through OMP's existing OpenAI Codex WebSocket provider, preserving live session/sticky-routing state.
  2. If WebSocket is unavailable or fails, use the existing SSE V2 and then V1 remote fallbacks.
  3. 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-residency

Platform

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 SSE fetch() 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:

  1. V2 compaction selects WebSocket when the provider/session supports it.
  2. WebSocket failure falls back to SSE V2, then V1 remote compaction.
  3. data_residency_mismatch remains a clear terminal remote error when every remote route rejects it.
  4. 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

  1. added
    agentAgent runtime planning and orchestration
    bugSomething isn't working
    prio:p2Medium: important but not urgent
    provider:openaiProvider-specific issues for openai
    providersLLM provider-specific issues
    on Jul 31, 2026
  2. roboomp commented on Jul 31, 2026

    @roboomp
    Collaborator

    Looking into this; I’ll report back with a focused transport-path reproduction.

  3. roboomp commented on Jul 31, 2026

    @roboomp
    Collaborator

    Reproduced the transport split with a focused provider probe: an openai-codex-responses model with preferWebsockets: true made 0 WebSocket connections and 1 SSE request through requestCompactionV2Streaming(), then surfaced the same response.failed (data_residency_mismatch) error. The bypass is in packages/agent/src/compaction/compaction-v2-streaming.ts; I’m fixing that path while preserving SSE V2 → V1 fallback.

  4. roboomp commented on Jul 31, 2026

    @roboomp
    Collaborator

    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.

  5. added 2 commits that reference this issue on Jul 31, 2026
    6c205fa
    636f9eb
  6. added 3 commits that reference this issue on Aug 1, 2026
    4638db4
    6684d2a
    8b84426
  7. added 3 commits that reference this issue on Oct 10, 2026
    afdfba4
    a2fa0a5
    21a2b10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentAgent runtime planning and orchestrationbugSomething isn't workingprio:p2Medium: important but not urgentprovider:openaiProvider-specific issues for openaiprovidersLLM provider-specific issuestriaged

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions