anomalyco / anomalyco/opencode

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

Open
#42,342 0 comments 0 reactions 1 assignee View on GitHub

@fwang is already working on this.

Since Aug 13, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

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 #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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.