Skip to content

fix(provider): forward agent temperature for config-defined custom models - #40973

Open
SeashoreShi wants to merge 1 commit into
anomalyco:devfrom
SeashoreShi:fix/custom-model-temperature-refresh2
Open

fix(provider): forward agent temperature for config-defined custom models#40973
SeashoreShi wants to merge 1 commit into
anomalyco:devfrom
SeashoreShi:fix/custom-model-temperature-refresh2

Conversation

@SeashoreShi

Copy link
Copy Markdown
Contributor

Summary

Config-defined custom models (e.g. provider.<id>.models in opencode.json) currently default to temperature: false, so an agent-level temperature setting is silently dropped for these models. This makes custom openai-compatible/other providers behave inconsistently with built-in models.

This PR defaults the temperature capability to enabled for config-defined custom models, unless the user explicitly sets temperature: false for that model. The agent's temperature is then forwarded to the provider request as expected.

Changes

  • packages/opencode/src/provider/provider.ts: default capabilities.temperature to true for config-defined custom models (explicit model.temperature still wins).
  • packages/opencode/test/provider/provider.test.ts: assert config-defined custom models report temperature: true by default.
  • packages/opencode/test/session/llm.test.ts: assert the provider request body actually carries the agent temperature for a custom openai-compatible model.

Notes

This replaces the previously auto-closed #34555 (opencode's automated PR cleanup closed it despite the fix being confirmed by a user on 1.18.4). The branch is rebased on the latest dev and conflicts are resolved.

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

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

Labels

contributor needs:compliance This means the issue will auto-close after 2 hours. needs:issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant