Skip to content

Error running remote compact task - Codex

Quick fix

Upgrade cc-switch to v3.12.0 or newer, which added forwarding for the Codex /responses/compact route in the local proxy, fixing the 404 or 502.

Error output
Error running remote compact task: unexpected status 404 Not Found: Unknown error, url: http://127.0.0.1:15721/v1/responses/compact

In cc-switch v3.11.x and earlier, the local proxy (port 15721 by default) did not pass through the `/v1/responses/compact` endpoint of the OpenAI Responses API. With remote compaction enabled in the Codex CLI, running `/compact` had the request intercepted by the local proxy, which returned 404 Not Found or 502 Bad Gateway. Fixed in v3.12.0 by adding forwarding logic for that route.

  1. Upgrade cc-switch to v3.12.0 or newer (maintainers suggest testing v3.12.3 if problems persist).

  2. Restart cc-switch and the Codex CLI, then run `/compact` in the terminal again for normal remote context compaction.

  3. If you cannot upgrade yet, turn the local proxy off on the cc-switch Proxy tab so Codex connects directly to a relay service that already supports the Responses API, as a stopgap.

ToolCodex CLI
VersionUnknown
PlatformsWindowsmacOSLinux
Why does remote compaction work once I turn the cc-switch proxy off?
With the local proxy off, Codex sends requests straight to the relay service (CPA, New API, and so on). Since mainstream relays already support `/v1/responses/compact`, this bypasses the routing interception defect in older cc-switch.
It still errors after upgrading to v3.12.0. What now?
Maintainers say that if the problem persists on v3.12.3, file a fresh issue. Make sure you fully restarted the cc-switch process after upgrading.

This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.