Skip to content

[FEATURE]: Zen model disable toggle is not enforced at the gateway - Codex keeps auto-using gpt-5.6-luna and billing continues #41697

Open

Description

@YiRan0
  • 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:

  1. Direct API call with my OpenCode Go key:
    POST https://opencode.ai/zen/go/v1/responses with model: "gpt-5.6-luna"
    → still returns HTTP 200 and completes normally.
  2. 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:

Zen usage: daily gpt-5.6-luna cost

Feature request

Please enforce model enable/disable at the OpenCode Go / Zen gateway:

  1. 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.
  2. Ideally, support a per-key model allowlist/blocklist (models_enabled / models_disabled) enforced server-side, instead of only affecting the /models list.
  3. 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

  1. Subscribe to OpenCode Go; configure provider base_url: https://opencode.ai/zen/go/v1, wire_api: responses.
  2. Use the provider in Codex desktop (main model, e.g. deepseek-v4-flash).
  3. Observe logs: internal requests with model=gpt-5.6-luna, prompt like "Fill the structured description field… / Current title: …", reasoning_effort=low.
  4. In Zen dashboard, disable gpt-5.6-luna.
  5. Call /responses directly with gpt-5.6-luna → still 200; Codex still auto-calls it and billing continues.

Environment

  • macOS; Codex desktop (ChatGPT.app bundled codex binary; 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:

  • [FEATURE/BUG] OpenCode Zen disabled models still appear in TUI picker (config drift risk) #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-luna even 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)

Activity

  1. github-actions commented on Aug 11, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • Feature requests must use the [FEATURE]: template: the title should start with [FEATURE]: and the issue body should include the required verification checkbox confirming you've searched for existing issues.

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


    This issue might be a duplicate of existing issues. Please check:

    If you believe this was flagged incorrectly, please let a maintainer know.

  2. changed the title [-]Feature request: Zen model disable toggle is not enforced at the gateway - Codex keeps auto-using gpt-5.6-luna and billing continues[/-] [+][FEATURE]: Zen model disable toggle is not enforced at the gateway - Codex keeps auto-using gpt-5.6-luna and billing continues[/+] on Aug 11, 2026
  3. YiRan0 commented on Aug 11, 2026

    @YiRan0
    Author

    Regarding the duplicate flag for #40560: this is related but not the same issue.

    • [FEATURE/BUG] OpenCode Zen disabled models still appear in TUI picker (config drift risk) #40560 = TUI model picker / /models catalog still shows disabled models (display/UX), and selecting one then fails at the gateway.
    • This issue = the gateway does not reliably reject or stop billing for a disabled model. After disabling gpt-5.6-luna in Zen, a direct POST /responses with that model still returns HTTP 200, completes, and generates billing records. The caller is Codex's internal helper agent, which hardcodes the model slug and cannot be configured client-side.

    So even a complete fix for #40560 (catalog filtering + picker UX) would not stop the cost in this scenario; only server-side enforcement (reject disabled model + no billing, per-key allowlist/blocklist, spend cap) can. I've also added the [FEATURE]: prefix and the verification checkbox to comply with the contributing guidelines.

  4. github-actions commented on Aug 11, 2026

    @github-actions
    Contributor

    Thank you for updating your issue! It now clearly explains the problem, includes steps to reproduce, environment details, and references related issues. Everything looks good — we appreciate the thorough write-up!

  5. sergiopadure commented on Oct 3, 2026

    @sergiopadure
    Contributor

    Same problem on an OpenCode Go subscription, and it goes beyond individual models: disabling the whole provider has no effect either.

    On 2026-10-03 I disabled the models I don't use (including qwen3.8-flash), then every model in the OpenCode Go model list, and finally the OpenCode Go provider entirely. The same Go API key keeps working throughout:

    • OpenCode v2.0.22, headless: opencode run -m opencode-go/qwen3.8-flash "Reply with exactly: OK" exits 0 with an answer from qwen3.8-flash. I ran it three times between 16:40 and 16:44 UTC, after qwen3.8-flash was disabled.
    • A separate OpenAI-compatible client, same key: chat completions for qwen3.8-flash returned HTTP 200 with tokens consumed, at 16:35 and 16:43 UTC.
    • After disabling the provider entirely: my own test later that afternoon still got answers.

    Expected: requests for a disabled model, and every request once the provider is disabled, are rejected (for example HTTP 403) and are not billed.

    As it stands, a subscriber has no way to stop a client from using, and being billed for, a model they have switched off, so the toggles give a false sense of control. This looks like a gateway enforcement bug rather than a feature request.

    Could someone from the team confirm whether these toggles are meant to be enforced at the gateway, and if so, prioritise the fix?

  6. gustavo-oo commented on Oct 6, 2026

    @gustavo-oo

    Adding another confirmation on an OpenCode Go subscription — this time the caller was OpenCode's own subagent, and the model has a small monthly allowance.

    Scenario

    • Workspace: wrk_01KS5JJ92HP249G45Y7YVT0GPF
    • I disabled Kimi K3 in the workspace Models tab.
    • Usage by model still shows Kimi K3 = $1.65 in the last 7 days. The calls came from one of my own OpenCode subagents (the task tool), not from an external client. Screenshots of the usage page and the disabled toggle are attached.

    Direct repro against the Go gateway (today, after the model was disabled)

    curl https://opencode.ai/zen/go/v1/chat/completions \
      -H "Authorization: Bearer <Go key>" \
      -H "x-opencode-session: ses_issue-repro-kimi-disabled" \
      -H "User-Agent: opencode/2.0.20" \
      -H "Content-Type: application/json" \
      -d '{"model":"kimi-k3","messages":[{"role":"user","content":"Reply with the single word: pong"}],"max_tokens":8}'

    Result: HTTP 200 with tokens billed:

    {"id":"727e4cf4d53bc3ec819ed8979335dcf9","object":"chat.completion","created":1791305279,"model":"kimi-k3","choices":[{"index":0,"finish_reason":"length","message":{"role":"assistant","content":"","reasoning_content":"The user wants me to reply with just"}}],"usage":{"prompt_tokens":92,"completion_tokens":8,"total_tokens":100,"prompt_tokens_details":{"audio_tokens":0,"cached_tokens":0,"cache_creation_input_tokens":0,"cache_write_tokens":0},"completion_tokens_details":{}}}

    Impact

    Kimi K3 has a $15/month allowance on Go, so $1.65 is ~11% of that model's allowance spent on a model I had switched off. As the comment above notes, the toggle gives a false sense of control.

    Expected

    The gateway should reject requests for workspace-disabled models (e.g. HTTP 403 with a model_disabled error) and not bill them, regardless of which client or subagent sends the request.

    Environment

    • opencode v2.0.20
    • macOS 25.6.0 (arm64), iTerm2, zsh
    • Subscription: OpenCode Go
    Image Image
  7. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    Thanks for the detailed write-up, and for tracking down the Codex side of this.

    To restate: you'd like the OpenCode Zen/Go gateway to enforce the Models tab toggle on the server. Requests for a model you've turned off would be rejected and not billed. You'd also like per-key model allow/block lists and spend/token caps as a safety net, because clients like Codex hardcode their helper-agent models and can't be configured to avoid them.

    This can't be done in the OpenCode app or with a plugin, because the requests come from Codex and only the gateway can block them. Maintainers will consider it, though there's no commitment on whether or when.

    Related issues:

    If you'd like the gpt-5.6-luna charges reviewed, billing isn't handled in GitHub issues. Please email [email protected] with the details, and keep account and payment information out of this public issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions