Skip to content

[Bug] OpenCode Go bills gpt-5.6-terra requests as gpt-5.6-luna (Codex Memories background jobs) #42342

Closed

Description

@liangjie78

Description

Using the OpenCode Go plan as the provider for OpenAI Codex desktop
(model_provider = "opencode-go", base_url = https://opencode.ai/zen/go/v1,
wire_api = responses, main model deepseek-v4-flash), Codex's built-in
Memories feature runs background jobs (memory_stage1,
memory_consolidate_global) after each session. Those jobs POST
{"model": "gpt-5.6-terra", ...} (reasoning_effort=medium) to
/responses with cwd ~/.codex/memories.

On the OpenCode workspace usage page, these requests are billed/displayed as
gpt-5.6-luna (go) — a model the user never selected and that never
appears as a request anywhere in the local Codex logs (zero
gpt-5.6-luna requests locally). So the gateway is either silently
substituting/renaming the model, or the usage page is mislabeling it, and the
result is charges the user cannot attribute to anything they did.

Examples from today (Asia/Shanghai, all from local memory_stage1 /
memory_consolidate_global jobs whose request log shows model=gpt-5.6-terra):

  • 21:17 — gpt-5.6-luna (go) $0.0496 (stage-1 summary job)
  • 22:26 — gpt-5.6-luna (go) 612,201 in / 3,956 out, $0.2826 (global memory consolidation)

Local Codex request log (~/.codex/logs_2.sqlite):
POST to https://opencode.ai/zen/go/v1/responses: {"model":"gpt-5.6-terra", ...}

Plugins

None relevant (plain Codex desktop + opencode-go provider).

OpenCode version

Go plan gateway (opencode.ai/zen/go/v1); usage page opencode.ai/workspace/.../usage.

Steps to reproduce

  1. Subscribe to OpenCode Go; configure Codex desktop with
    model_provider = "opencode-go" (zen/go/v1, responses API), main model
    deepseek-v4-flash.
  2. Keep Codex Memories enabled (~/.codex/config.toml:
    [memories] generate_memories = true).
  3. Finish a Codex session (triggers memory_stage1) and let global
    consolidation (memory_consolidate_global) run.
  4. Open the workspace usage page → new records appear under
    gpt-5.6-luna (go).
  5. Check local Codex logs → requests were sent with model=gpt-5.6-terra;
    no gpt-5.6-luna request exists locally.

Screenshot and/or share link

Can share usage-page screenshots and log excerpts on request.

Operating System

Windows 11 x64

Terminal

Codex Desktop (26.803.81509) / Codex CLI 0.147.0-alpha

Expected behavior

  • Either gpt-5.6-terra is available on the Go plan and is billed/displayed
    as gpt-5.6-terra, or the gateway rejects it (4xx) instead of silently
    executing and billing a different model (gpt-5.6-luna).
  • The usage page should show the actual requested/billed model so users can
    trace unexpected charges.
  • Ideally, server-side enforcement (per-key model allowlist/blocklist) so
    hardcoded client-side model usage like this can be stopped without changing
    the client (related to [FEATURE]: Zen model disable toggle is not enforced at the gateway - Codex keeps auto-using gpt-5.6-luna and billing continues #41697, which covers the disable-toggle gap for
    gpt-5.6-luna; this report adds the distinct model substitution
    behavior and the Codex Memories background caller).

Happy to provide workspace/session details to maintainers for debugging.

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