Skip to content

Agent temperature is dropped for config-defined custom OpenAI-compatible models #34554

Closed as not planned

Description

@SeashoreShi

Description

When a model is defined only in opencode.json under a custom provider, agent.<name>.temperature can be silently dropped even though the request goes through the OpenAI-compatible path.

This happens because the custom-model merge path defaults capabilities.temperature to false when the config entry omits that field. Session request construction then strips temperature before the provider request is built.

Steps to reproduce

Use a config like:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "myprovider": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "maas",
      "options": {
        "baseURL": "http://localhost:8090/v1",
        "apiKey": "test-key"
      },
      "models": {
        "MiniMax-M2.7": {
          "tool_call": true,
          "limit": { "context": 32000, "output": 8000 }
        }
      }
    }
  },
  "agent": {
    "build": { "temperature": 1 }
  }
}

Send a request with the build agent and inspect the outgoing OpenAI-compatible payload.

Expected behavior

The request should include the configured temperature.

Actual behavior

temperature is omitted unless the model config explicitly sets "temperature": true.

OpenCode version

1.17.11

Operating System

Windows 11

Terminal

Powershell

Activity

  1. github-actions commented on Jun 30, 2026

    @github-actions
    Contributor

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

  2. SeashoreShi commented on Aug 8, 2026

    @SeashoreShi
    ContributorAuthor

    Hi, I've opened a fix for this: #41016. It defaults the temperature capability to enabled for config-defined custom models (explicit temperature: false still wins), and includes regression tests verifying the agent temperature is forwarded in the request body. Verified locally: 129 pass / 0 fail across the provider and llm suites.

  3. github-actions commented on Oct 7, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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