Skip to content

config: existing model limit override is ignored #37544

Description

@akuendig

Summary

A configured limit.context override for the existing openai/gpt-5.6-sol catalog model is ignored. This prevents users from lowering the effective context limit to trigger automatic compaction earlier.

Environment

  • opencode version: opencode2 v0.0.0-next-15766 (also reproduced on 0.0.0-next-15760)
  • OS: Linux 7.0.9-ogc3.2.fc44.x86_64 x86_64
  • Terminal: TERM_PROGRAM=tmux, TERM=xterm-256color, COLORTERM=truecolor
  • Shell: /bin/bash
  • Install/channel: globally installed next channel
  • Active plugins: No user-configured plugins or local plugin files found

Reproduction

  1. Add the following to ~/.config/opencode/opencode.jsonc:

    {
      "$schema": "https://opencode.ai/config.json",
      "providers": {
        "openai": {
          "models": {
            "gpt-5.6-sol": {
              "limit": {
                "context": 308000
              }
            }
          }
        }
      }
    }
  2. Restart the shared service:

    opencode2 service restart
  3. Inspect the resolved model:

    opencode2 api get /api/model \
      | jq '.data[] | select(.id == "gpt-5.6-sol") | {id, modelID, providerID, limit}'
  4. Observe that the configured context limit is not present.

Expected Behavior

The existing catalog entry should be overlaid with the configured partial limit:

{
  "limit": {
    "context": 308000,
    "input": 922000,
    "output": 128000
  }
}

Automatic compaction should therefore use approximately 308000 - 128000 = 180000 tokens as its preflight threshold with the default compaction buffer.

Actual Behavior

The resolved model retains the original catalog limits:

{
  "id": "gpt-5.6-sol",
  "modelID": "gpt-5.6-sol",
  "providerID": "openai",
  "limit": {
    "context": 1050000,
    "input": 922000,
    "output": 128000
  }
}

The behavior is consistent across service restarts. It reproduced on both 0.0.0-next-15760 and 0.0.0-next-15766.

Additional Context

  • The configuration uses the documented V2 providers shape from https://v2.opencode.ai/models.
  • Restarting the background service does not help.
  • Changing the configured model into a custom alias also did not make the model appear in /api/model.
  • No user-configured plugins were found.
  • The service remains healthy after restart.

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions