Skip to content

[Bug]: Quota-limited previous-model compact blocks Sol → routed DeepSeek handoff after manual /compact succeeds #2723

Description

@juzijia

Client or integration

Codex App (Desktop) through OpenCodex loopback proxy integration.

Area

Proxy and routing

Summary

A thread that previously used gpt-5.6-sol can be switched in-place to the routed model deepseek/deepseek-v4-flash, and a manual /compact succeeds with the current routed DeepSeek model. However, the next normal user turn triggers Codex's pre-sampling previous-model compaction. The first compaction attempt intentionally uses the previous model (gpt-5.6-sol). If the Sol/ChatGPT quota is exhausted, OpenCodex records that compact attempt as an upstream failure and the turn stops before the current routed DeepSeek model can continue.

Observed failing compact record:

provider=openai
model=gpt-5.6-sol
status=502
code=upstream_server_error
termination=incomplete
error=The usage limit has been reached

No subsequent compact retry to deepseek/deepseek-v4-flash was observed for that blocked turn.

This report is not claiming that the first previous-model compact attempt is incorrect. Upstream Codex intentionally performs previous-model pre-sampling compaction during some model transitions. The compatibility problem is that, through OpenCodex's same-thread routed-model setup, a quota failure on the previous OpenAI model prevents the handoff to the already-working current routed model.

Upstream Codex has also broadened previous-model compact fallback to include usage-limit, unexpected-status, server and exhausted-retry failures:

Expected OpenCodex behavior is one of the following, depending on what context is available at the proxy layer:

  1. Preserve/translate the previous-model quota failure so Codex can trigger its selected/current-model compact fallback; or
  2. provide an equivalent OpenCodex compatibility fallback from the unavailable previous route to the current routed model; or
  3. if neither is safe, surface/document this limitation explicitly instead of leaving the routed thread blocked by the previous provider's quota.

Reproduction

  1. Run OpenCodex 2.31.0 with Codex App loopback integration and a routed DeepSeek model available as deepseek/deepseek-v4-flash.
  2. Start or resume a thread that has been using gpt-5.6-sol.
  3. Exhaust the ChatGPT/OpenAI usage allowance for gpt-5.6-sol.
  4. In the same thread, switch the current model to deepseek/deepseek-v4-flash.
  5. Run /compact manually.
  6. Observe that manual compaction succeeds with the current routed model.
  7. Send a normal user message to continue the thread.
  8. Codex performs pre-sampling model-transition compaction against the previous model gpt-5.6-sol.
  9. OpenCodex records the compact request as provider=openai, model=gpt-5.6-sol, status=502, error=The usage limit has been reached.
  10. The turn stops; no DeepSeek compact fallback is observed.
  11. After the Sol quota resets, the same model-switch workflow can continue normally again.

This reproduces a narrow handoff failure: DeepSeek compaction itself is usable, but the previous-model pre-sampling compact failure blocks continuation before the routed current model gets control.

Version

OpenCodex 2.31.0

Operating system

Windows x64 (NT 10.0; exact edition/build not captured)

Provider and model

Previous model/provider:

OpenAI / ChatGPT
model=gpt-5.6-sol

Current routed model:

DeepSeek via OpenCodex
model=deepseek/deepseek-v4-flash

Logs or error output

Error running remote compact task: stream disconnected before completion:
stream closed before response.completed

Matching OpenCodex usage record at the compact failure timestamp:

provider=openai
model=gpt-5.6-sol
status=502
code=upstream_server_error
termination=incomplete
error=The usage limit has been reached

Control observation:

manual /compact on current routed DeepSeek -> succeeds
next normal turn -> previous-model Sol pre-compact -> quota failure -> turn blocked
Sol quota reset -> model-switch workflow works again

Screenshots and supporting files

Relevant upstream Codex behavior/fixes:

Relevant OpenCodex compact routing implementation:

Redacted configuration

{
  "note": "Credentials, account identifiers, unrelated providers, and secrets removed",
  "routedModel": "deepseek/deepseek-v4-flash",
  "integration": "Codex App loopback proxy"
}

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

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

    account-poolOAuth, credentials, Codex pool, quota, failover, plansbugSomething isn't workingproxyHTTP proxy, routing, reverse-proxy / management auth

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions