A CLIProxyAPI request-interceptor plugin that transpiles Codex multi-agent agent_message payloads (encrypted_content) into plaintext input_text, so DeepSeek and other OpenAI-compatible endpoints can receive spawn / followup / send_message tasks.
- Codex 0.149 multi-agent delegation (
spawn_agent/followup_task/send_message) puts the task text in plaintext insideInterAgentCommunication.encrypted_content; when serialized for the model endpoint it becomes an{"type":"encrypted_content","encrypted_content":"<task text>"}block next to theinput_textenvelope (Message Type: ... Payload:\n). - The official OpenAI Responses endpoint consumes that block natively, but DeepSeek and other openai-compat endpoints silently drop it — child agents only see an empty
Payload:. - CLIProxyAPI 7.2.141's native
openai-response → openaiconversion only understandsinput_text/input_image, so it dropsencrypted_contenttoo.
The plugin registers the request_interceptor capability and implements request.intercept_before. The host calls it at the handler layer, before any native format conversion, with the client's original responses request body (including the plaintext encrypted_content blocks). The plugin:
- Parses the request body and walks the
input[]items. - For each
encrypted_contentblock with a value, appends the value (\n<value>) to the lastinput_textblock of the same item whose text containsMessage Type:orPayload:; if no matchinginput_textexists, the block is replaced with{"type":"input_text","text":"<value>"}. - Deletes the
encrypted_contentblocks and returns the rewritten body.
Only requests whose Model (or RequestedModel) contains deepseek are rewritten; all other traffic passes through untouched. request.translate is also implemented with the same rules as a fallback for hosts without a native route.
Place codex-msg-translator.dll in the main program's plugin directory, e.g.:
<CLIProxyAPI app dir>\plugins\windows\amd64\codex-msg-translator.dll
Enable it in config.yaml:
plugins:
enabled: true
configs:
codex-msg-translator:
enabled: true
priority: 10Restart CLIProxyAPI (or hot-reload if your management panel supports it) after changing the config.
Requires Go with CGO. On Windows with mingw:
CGO_ENABLED=1 go build -buildmode=c-shared -o codex-msg-translator.dll .Or cross-compile from Linux:
GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc go build -buildmode=c-shared -o codex-msg-translator.dll .A one-command helper is provided (uses local mingw when available, otherwise Docker cross-compilation):
.\build.ps1 # builds the dll, packages the release zip and writes checksums.txt- The plugin is registered: management API shows
registered=trueandmain.logcontainsplugin loaded/plugin registeredwith noinvalid metadata/unsupported schema version. - Trigger a DeepSeek request (e.g. a Codex multi-agent task) and check the plugin log at
%USERPROFILE%\.cli-proxy-api\logs\codex-msg-translator.logfor:
request.intercept_before | model=deepseek-... modified=true encrypted=N input_items=X->Y body_len=A->B ...
modified=false reason=no_encrypted for ordinary requests is expected and healthy.
- The plugin only rewrites requests whose model hits the
deepseekdomain; other models keep the originalencrypted_contentpath. - Only the outbound request is rewritten; response-side behavior is untouched.
- Log lines record the first 80 chars of encrypted payload content (task text may contain sensitive information).
- To disable: set
configs.codex-msg-translator.enabled: false(or delete the dll) and restart. The host fuses failing plugins and passes traffic through untouched, so an unhealthy plugin cannot break production.