anomalyco / anomalyco/opencode
[FEATURE]: Zen model disable toggle is not enforced at the gateway - Codex keeps auto-using gpt-5.6-luna and billing continues
@fwang is already working on this.
Since Aug 11, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
- I have verified this feature I'm about to request hasn't been suggested before.
Summary
I'm an OpenCode Go (Zen) subscriber. I use my Go plan as the provider for Codex desktop (base_url: https://opencode.ai/zen/go/v1, wire_api: responses).
While using Codex, it automatically calls gpt-5.6-luna (a model I never selected) for its internal helper agents (task title generation, thread description refresh). This model name is hardcoded in the Codex binary — there is no config override, so I cannot stop it from the Codex side. Upstream confirms this: openai/codex#28741 (task title generation hardcodes a bare model slug, with no config override unlike memories.extract_model); openai/codex#29942 only adds a fallback when a model is unavailable — but luna returns 200 on the OpenCode Go gateway, so the fallback never triggers.
The core problem: disabling the model in Zen has no effect at the gateway
I disabled gpt-5.6-luna in the Zen dashboard, but:
- Direct API call with my OpenCode Go key:
POST https://opencode.ai/zen/go/v1/responseswithmodel: "gpt-5.6-luna"
→ still returns HTTP 200 and completes normally. - Codex keeps auto-calling luna and billing records keep being generated.
So the Zen toggle only affects the client-side model list (the "enable" direction works, see #17550), but the gateway does not enforce it: calls still succeed and still bill.
Impact
- One billing record (Aug 11, 13:55):
gpt-5.6-luna, ~186,000 tokens, $0.0419. - Each thread-description refresh triggers ~7 sampling requests (
reasoning_effort=low), accumulating to roughly $1/day of unexpected cost. - Zen Usage filtered to
gpt-5.6-luna(Aug 2026), daily cost bars Aug 7–11:

Feature request
Please enforce model enable/disable at the OpenCode Go / Zen gateway:
- When a model is disabled in Zen, API requests for that model should be rejected (e.g. 403/400) for the affected API key and not billed.
- Ideally, support a per-key model allowlist/blocklist (
models_enabled/models_disabled) enforced server-side, instead of only affecting the/modelslist. - Optional safety net: spend/token caps per key.
Because the caller (Codex internal helpers) hardcodes the model and cannot be configured client-side, only server-side enforcement can stop this.
Steps to reproduce
- Subscribe to OpenCode Go; configure provider
base_url: https://opencode.ai/zen/go/v1,wire_api: responses. - Use the provider in Codex desktop (main model, e.g.
deepseek-v4-flash). - Observe logs: internal requests with
model=gpt-5.6-luna, prompt like "Fill the structured description field… / Current title: …",reasoning_effort=low. - In Zen dashboard, disable
gpt-5.6-luna. - Call
/responsesdirectly withgpt-5.6-luna→ still 200; Codex still auto-calls it and billing continues.
Environment
- macOS; Codex desktop (ChatGPT.app bundled
codexbinary; contains migration note "GPT-5.4 Mini is no longer available. Codex now uses GPT-5.6 Luna") - OpenCode Go provider (
zen/go/v1, Responses API)
Relationship to #40560 (not a duplicate)
#40560 is about the TUI model picker / /models catalog: disabled models still appear in the picker (UX/display issue), and selecting one then fails at the gateway.
This issue is about a different, more severe gap: the gateway itself does not reliably reject or stop billing for a disabled model:
- #40560 implies the gateway errors when a disabled model is selected — but in my case the gateway returns HTTP 200 and completes (and bills) for
gpt-5.6-lunaeven after I disabled it in Zen. Enforcement appears inconsistent. - The caller here is Codex's internal helper agents, which hardcode the model slug and cannot be configured client-side, so even a perfect TUI/catalog fix in OpenCode would not help — only server-side rejection + no billing (and ideally a per-key allowlist/blocklist + spend cap) can stop the cost.
Related
- openai/codex#28741 – task title generation hardcodes model, no config override
- openai/codex#29942 – fallback only when model is unavailable
- #17550 – models must be enabled in Zen to appear in
/models(enable direction only) - #32328 – Go plan model visibility
- #6979 / #24832 / #18393 – disable mechanisms not honored
- #40621 – gpt-5.6-luna rejected by region on the same Go plan (related scenario)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.