Skip to content

Model discovery hides configured presets that share a model family #63708

Done

Description

@smnmsr

Description

The opencode.models tool hides explicitly configured model presets when they share a family.

For example, two enabled aliases targeting gpt-6.1-sol with different reasoning settings appear separately in the TUI picker, but only one appears in the tool's default results. Using all: true returns both.

Expected: distinct presets remain discoverable, while older base-model versions can still be filtered.

Plugins

No response

OpenCode version

2.2.7

Steps to reproduce

  1. Add these presets to opencode.json:
{
  "providers": {
    "opencode": {
      "models": {
        "preset-low": {
          "modelID": "gpt-6.1-sol",
          "name": "Preset Low",
          "disabled": false,
          "settings": { "reasoningEffort": "low" }
        },
        "preset-high": {
          "modelID": "gpt-6.1-sol",
          "name": "Preset High",
          "disabled": false,
          "settings": { "reasoningEffort": "high" }
        }
      }
    }
  }
}
  1. With access to the opencode provider, call the opencode.models tool with:
    {"provider":"opencode","query":"preset"}

  2. Only one preset is returned.

  3. Repeat with:
    {"provider":"opencode","query":"preset","all":true}

  4. Both presets are returned.

Screenshot

No response

Operating System

Omarchy 4.5.0

Terminal

No response

Activity

  1. added
    area/core
    inference/zen
    type/bug
    version/v2
    on Nov 13, 2026
  2. opencodejr commented on Nov 13, 2026

    @opencodejr
    Contributor

    Seen with a simulated model or a mock server, not a real provider; a maintainer should confirm.

    Thanks for the clear report. I reproduced this on 2.2.7, and it still happens on the latest dev (73abe63).

    What I did: loaded your two presets (preset-low and preset-high, both modelID: gpt-6.1-sol) and called opencode.models with {"provider":"opencode","query":"preset"}, then again with all: true.

    What happened:

    • Default call: only opencode/preset-low (total=1).
    • With all: true: both presets (total=2).

    The recording, screenshot and script below show the run. A simulated model only triggered the tool call. The tool ran for real against the models catalog bundled with the release.

    Likely cause: by default the tool keeps one model per provider and model family. Your presets inherit gpt-6.1-sol's family and release date, so one of them is dropped, even though the all option is described as only including older versions of a family.

    recording.mp4

    Screenshot

    Reproduction script (drive.ts)
    // Reproduces anomalyco/opencode#63708: opencode.models hides a configured preset
    // that shares a model family with another preset of the same base model.
    //
    // The simulation answers the models.dev fetch with an empty catalog, so load the real
    // catalog (the snapshot bundled with the release) so the presets inherit gpt-6.1-sol's family:
    //   git -C /workspace/repo show v2.2.7:packages/core/src/models-dev/snapshot.txt > /tmp/opencode/models.json
    //   OPENCODE_MODELS_PATH=/tmp/opencode/models.json OPENCODE_DISABLE_MODELS_FETCH=1 \
    //     OPENCODE_DRIVE_MEDIA_DIR=/workspace/media opencode-drive run drive.ts
    import { Effect, Stream } from "effect"
    import { Llm, OpenCodeDriver } from "opencode-drive"
    
    const code = `
    const def = await tools.opencode.models({ provider: "opencode", query: "preset" })
    const all = await tools.opencode.models({ provider: "opencode", query: "preset", all: true })
    const ids = (r) => r.providers.flatMap((p) => p.models.map((m) => m.id)).join(",")
    return "DEFAULT=[" + ids(def) + "] total=" + def.total + " ALL=[" + ids(all) + "] total=" + all.total
    `
    
    export default OpenCodeDriver.use(
      {
        ...(process.env.OC_DEV ? { opencode: { dev: process.env.OC_DEV } } : {}),
        tui: { recording: true },
        config: {
          model: "simulation/gpt-sim-model",
          providers: {
            opencode: {
              models: {
                "preset-low": { modelID: "gpt-6.1-sol", name: "Preset Low", disabled: false, settings: { reasoningEffort: "low" } },
                "preset-high": { modelID: "gpt-6.1-sol", name: "Preset High", disabled: false, settings: { reasoningEffort: "high" } },
              },
            },
          },
        } as any,
      },
      ({ ui, llm }) =>
        Effect.gen(function* () {
          yield* llm.serve((request, index) => {
            const text = JSON.stringify(request)
            if (!text.includes("call_models"))
              return Stream.make(
                Llm.toolCall({ index: 0, id: "call_models", name: "execute", input: { code } }),
                Llm.finish("tool-calls"),
              )
            const match = /DEFAULT=\[[^\]]*\] total=\d+ ALL=\[[^\]]*\] total=\d+/.exec(text.replace(/\\"/g, '"'))
            console.log("TOOL RESULT:", match?.[0] ?? JSON.stringify((request as any).body?.messages?.slice(-1)))
            return Stream.make(Llm.text("Result: " + (match?.[0] ?? "no match")))
          })
          yield* ui.submit("List the preset models")
          yield* ui.waitFor("Result:")
          yield* ui.screenshot("result")
        }),
    )

    Run it with opencode-drive: opencode-drive run ./drive.ts. It drives opencode from your PATH; set OC_DEV to the path of an OpenCode checkout to run that from source instead.

  3. added
    status/repro-simulated
    on Nov 13, 2026
  4. smnmsr commented on Nov 24, 2026

    @smnmsr
    Author

    Fixed by #65071, which keeps same-day model siblings and returns every search match in the models tool. This resolves the reproduction reported here. Thanks!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/coreinference/zenplatform/linuxstatus/repro-simulatedtype/bugversion/v2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions