Openai Codex Headers
Stopgap opencode plugin that smooths the OpenAI/Codex GPT-5.6 rough edges (Luna 404s, missing session titles, reasoning-summary markers) until native support lands
0
184
46 in 7 days
29.5
Multi-signal model
2 months ago
2026-07-10
Install and configure
opencode.jsonWrites to this project's opencode.json — applies to this repository only.
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-openai-codex-headers@1.2.7"]
}Writes to ~/.config/opencode/opencode.json — applies to every project.
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-openai-codex-headers@1.2.7"]
}If you want to modify the plugin locally, install it into the project and reference the local path.
shell
pnpm add -D opencode-openai-codex-headersOpenCode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.
An opencode plugin for ChatGPT Plus/Pro users on the Codex backend. It smooths over the rough edges in opencode's OpenAI/Codex integration for the GPT-5.6 models (Sol, Terra, Luna) until native support lands upstream.
What it fixes
- Luna 404s. GPT-5.6 Luna models return
404 Model not found. The Codex backend gates them on the client identity, and opencode identifies asopencoderather than the Codex CLI. The plugin restores the genuine Codex signature so Luna is served, and keeps Terra in the Codex priority tier so it stops load-shedding withserver_is_overloadedunder contention. - Missing session names. opencode's title agent runs on a Luna model, so the
same 404 leaves every session stuck on its default
New session - <timestamp>name. Recovering Luna fixes the titles. - Reasoning-summary markers. GPT-5.6 ends each reasoning summary with an empty
<!-- -->comment that opencode's TUI renders literally under the "Thought" headline. The plugin strips it on the wire so only the headline remains.
Install
Via the opencode CLI (-g writes it to your global config; drop it for the
current project):
opencode plugin opencode-openai-codex-headers -g
Manual: add it to the plugin array in your opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-openai-codex-headers"]
}
How it works
Identity. A chat.headers hook overwrites originator and User-Agent on the
openai provider only, so requests present the genuine Codex CLI signature (the
backend requires both). It loads after opencode's internal hooks and runs against
the same shared output, so it wins; every other provider is untouched.
Reasoning cleanup. opencode exposes no hook to transform reasoning text, so the
plugin rewrites the summary events on the wire, on both the HTTP/SSE path and
opencode's experimental WebSocket transport. It touches only reasoning delta events
on /responses endpoints (host-agnostic, so it also works through a proxy or custom
baseURL); everything else passes through unchanged.
License
MIT
Similar plugins
Oc Codex Multi Auth
oc-codex-multi-auth
OpenCode plugin for ChatGPT Plus/Pro OAuth with Codex/GPT-5 routing, multi-account rotation, account switching, health checks, diagnostics, and recovery tools
Magic Compact
magic-compact
Lossless context compression plugin for OpenCode.
Gpt Imagegen
opencode-gpt-imagegen
OpenCode plugin for GPT Image 2 generation through your ChatGPT subscription, with reference images and safe PNG output.