gitmyhub

cpa-plugin-codexcomp

Go ★ 75 updated 9d ago

CLIProxyAPI plugin that detects and repairs gpt-5.5 reasoning truncation (518n−2 pattern) via encrypted_content replay and multi-round folding

A Go plugin for CLIProxyAPI that detects when certain GPT-5.5 models cut off their reasoning mid-thought and automatically continues them.

GoCLIProxyAPIsetup: moderatecomplexity 4/5

CodexComp is a plugin for CLIProxyAPI, a proxy tool that sits between AI coding agents and language model providers. Its job is to detect and fix a specific technical problem where certain models, by default gpt-5.5 and two related variants called luna and terra, sometimes cut off their internal reasoning at an oddly precise token count. The README explains that when this cutoff happens, the model's answers can become noticeably worse, since it was not actually finished thinking through the problem.

The plugin works by watching streaming responses from these models. If it detects that the model's reasoning stopped at the telltale truncated point, and the response includes reusable encrypted reasoning content, it automatically sends a follow up request that replays the original question along with everything the model already thought, asking it to continue from where it left off. It can do this up to three times by default. All of these extra rounds are combined into what looks like a single normal response, so the client application calling the model never sees anything unusual happen.

Because some of these models can take up to thirty seconds to produce their first piece of output when reasoning hard, and many client tools time out well before that, the plugin uses an asynchronous streaming approach. It returns response headers immediately and forwards each piece of the model's output to the client as soon as it arrives from the upstream provider.

The plugin only intercepts streaming requests for the configured models, and only when the request format matches certain conditions, so it stays out of the way of unrelated requests. It compares itself in the README to two earlier Python based tools that solve a similar problem, noting that this version is written in Go and loads directly inside CLIProxyAPI as a plugin, rather than running as its own separate proxy process.

It is distributed under the MIT license, is installable through the CLIProxyAPI plugin store or as a manually downloaded binary, and includes a benchmark script for testing whether it is actually fixing the truncation problem on your setup.

Where it fits