Skip to content

feat(opencode-go): opt-in temperature for Responses models (#2055) - #2160

Merged
taltas merged 2 commits into
Zoo-Code-Org:mainfrom
AntzCode:feature/opencode-go-responses-temperature-2055
Oct 24, 2026
Merged

taltas merged 2 commits into
Zoo-Code-Org:mainfrom
AntzCode:feature/opencode-go-responses-temperature-2055

Conversation

@AntzCode

Copy link
Copy Markdown
Contributor

OpenCode Go Responses-format models now send temperature only for verified model and reasoning-effort combinations. This applies to both the streaming and non-streaming Responses requests. The settings UI uses the same rule: it hides the temperature control when the value would not be sent. Hiding the control does not clear or reset a saved temperature.

  • grok-4.6, muse-spark-1.3-contributor and muse-spark-1.2-contributor: temperature is sent at any reasoning effort.
  • gpt-5.6-luna and gpt-6-luna: temperature is sent only when the effective reasoning effort is "none". At other efforts the gateway returns HTTP 400 for every value except 1, which is the OpenAI reasoning default rather than real support, so the value is left out.
  • Temperature is sent only when the user has set a custom value. The provider default is never sent on this route.

Related GitHub Issue

Refs #2006
Closes #2055

Description

  • types: add OPENCODE_GO_TEMPERATURE_REASONING_EFFORTS and opencodeGoResponsesSupportsTemperature(), and set supportsTemperature on every Responses model.
  • handler: add getResponsesTemperature(), which reads the raw modelTemperature setting and applies the opt-in rule; remove the unused temperature parameter from streamResponsesMessage; update the route comments so they no longer say the Responses route is Luna-only.
  • webview: add isTemperatureControlSupported(), which ApiOptions uses to decide whether to show TemperatureControl. It works out the effective reasoning effort the same way the request builder does.
  • tests: cover the rule, the model registry, the fetcher merge, both request modes, a stale "none" effort while reasoning is switched off, and the UI visibility round trip with the saved value kept.

Shared transforms (getModelParams, RouterProvider) are unchanged.

Test Procedure

  1. Create a provider profile using the Opencode Go provider and valid api access token.
  2. Select a model that supports responses and that satisfies your test case (eg: gpt-6-luna, grok-4.7).
  3. Observe that the temperature setting is available when the model's conditions are met (described above).
  4. Submit prompts and observe the model thinks and responds.
  5. Notice the model's performance changes when temperature is adjusted.
  6. gpt-5.6-luna and gpt-6-luna only: select any non-"none" reasoning effort: observe temperature UI is hidden.
  7. Submit a prompt-enhancement (settings > prompts), with the selected model and a custom temperature.

Tested extensively with all 5 named models, and tested with the prompt enhancement feature. Observed varying degrees of performance and generally functional. (noticed poor performance and high failure rate with the extreme low and extreme high temperature values - seems typical of the model responses observed while testing #2006).

Pre-Submission Checklist

  • [*] Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • [*] Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • [*] Self-Review: I reviewed my own code with care.
  • [*] Writing Style: The PR title and description use Simplified Technical English (ASD-STE100): short sentences, plain words, active voice, one idea per sentence, no contractions.
  • [*] Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • [N/A] Visual Snapshot (UI changes only): If a user would notice this change at a glance (layout, theme tokens, brand elements, empty/error states), I added or updated a *.visual.tsx snapshot in webview-ui/. See webview-ui/AGENTS.md → "When a UI change needs a snapshot".
  • [*] Documentation Impact: I checked if my changes need documentation updates (see "Documentation Updates" section below).
  • [*] Contribution Guidelines: I read and agree to the Contributor Guidelines.

Visual Snapshots

N/A. The change is behavior-only: it changes when the existing temperature control is shown for OpenCode Go Responses models, and the control's look is unchanged. The visibility rule is covered in Vitest (temperatureSupport.spec.ts, ApiOptions.spec.tsx), per webview-ui/AGENTS.md.

Videos (interaction / animation only)

https://github.com/user-attachments/assets/831a9fbb-d22b-45ca-98ef-85b0f97d597e
Shows some testing of various models using streaming path (via Ask agent) + mitmproxy to verify request payload

https://github.com/user-attachments/assets/1d7d4d5a-3028-4753-901d-7107170b1ea8
Shows some testing of various models using non-streaming path (via prompt-enhancement tab) + mitmproxy to verify request payload

Documentation Updates

  • [*] No documentation updates are required.

  • No docs page in this repo explains OpenCode Go settings or temperature. OpenCode Go appears only in the README's release highlights and in CHANGELOG/README translations, which are updated in bulk at release time.

  • The change is self-explanatory in the UI: the temperature control appears when it works and is hidden when it doesn't, and a saved value is never lost.

  • The rationale (Luna accepts temperature only at reasoning effort "none") goes in the [ENHANCEMENT] Support verified temperature capability for OpenCode Go Responses models #2055 closing comment and the code JSDoc, not user docs.

Get in Touch

Discord: anthony_25019

…Org#2055)

OpenCode Go Responses-format models now send temperature only for verified
model and reasoning-effort combinations. This applies to both the streaming
and non-streaming Responses requests. The settings UI uses the same rule: it
hides the temperature control when the value would not be sent. Hiding the
control does not clear or reset a saved temperature.

- grok-4.6, muse-spark-1.3-contributor and muse-spark-1.2-contributor:
  temperature is sent at any reasoning effort.
- gpt-5.6-luna and gpt-6-luna: temperature is sent only when the effective
  reasoning effort is "none". At other efforts the gateway returns HTTP 400 for
  every value except 1, which is the OpenAI reasoning default rather than real
  support, so the value is left out.
- Temperature is sent only when the user has set a custom value. The provider
  default is never sent on this route.

Changes:
- types: add OPENCODE_GO_TEMPERATURE_REASONING_EFFORTS and
  opencodeGoResponsesSupportsTemperature(), and set supportsTemperature on
  every Responses model.
- handler: add getResponsesTemperature(), which reads the raw modelTemperature
  setting and applies the opt-in rule; remove the unused temperature parameter
  from streamResponsesMessage; update the route comments so they no longer say
  the Responses route is Luna-only.
- webview: add isTemperatureControlSupported(), which ApiOptions uses to decide
  whether to show TemperatureControl. It works out the effective reasoning
  effort the same way the request builder does.
- tests: cover the rule, the model registry, the fetcher merge, both request
  modes, a stale "none" effort while reasoning is switched off, and the UI
  visibility round trip with the saved value kept.

Shared transforms (getModelParams, RouterProvider) are unchanged.

Refs Zoo-Code-Org#2006
Closes Zoo-Code-Org#2055

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between a71496d and 5689144.

⛔ Files ignored due to path filters: 1
  • webview-ui/src/components/settings/__tests__/__screenshots__/opencode-go-temperature.png is excluded by !**/*.png, !webview-ui/**/__screenshots__/**
📒 Files selected for processing: 3
  • webview-ui/playwright/gallery/stories.tsx
  • webview-ui/src/components/settings/__tests__/OpencodeGoTemperature.visual.fixture.tsx
  • webview-ui/src/components/settings/__tests__/OpencodeGoTemperature.visual.tsx

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

📜 Recent review details
🧰 Additional context used
📚 Code guidelines: 1
webview-ui/AGENTS.md — auto-discovered
📓 Path-based instructions: 7
For persisted settings, verify the complete schema/storage/runtime/webview round trip, shared default semantics, and focused true plus false/unset tests.

⚙️ CodeRabbit configuration file

Files:

  • webview-ui/src/components/settings/__tests__/OpencodeGoTemperature.visual.tsx
  • webview-ui/src/components/settings/__tests__/OpencodeGoTemperature.visual.fixture.tsx
Require regression coverage at the lowest valid harness with behavior-focused assertions, including relevant negative, error, false/unset, and boundary cases.

⚙️ CodeRabbit configuration file

Files:

  • webview-ui/src/components/settings/__tests__/OpencodeGoTemperature.visual.tsx
  • webview-ui/src/components/settings/__tests__/OpencodeGoTemperature.visual.fixture.tsx
Check strict typing and exhaustive behavior across normal, boundary, error, cancellation, retry, and compatibility paths.

⚙️ CodeRabbit configuration file

Files:

  • webview-ui/playwright/gallery/stories.tsx
  • webview-ui/src/components/settings/__tests__/OpencodeGoTemperature.visual.tsx
  • webview-ui/src/components/settings/__tests__/OpencodeGoTemperature.visual.fixture.tsx
Check React state and effect dependencies, cleanup, accessibility, i18n, and light/dark theme behavior.

⚙️ CodeRabbit configuration file

Files:

  • webview-ui/playwright/gallery/stories.tsx
  • webview-ui/src/components/settings/__tests__/OpencodeGoTemperature.visual.tsx
  • webview-ui/src/components/settings/__tests__/OpencodeGoTemperature.visual.fixture.tsx
Act as an adversarial second-opinion reviewer.

⚙️ CodeRabbit configuration file

Files:

  • webview-ui/playwright/gallery/stories.tsx
  • webview-ui/src/components/settings/__tests__/OpencodeGoTemperature.visual.tsx
  • webview-ui/src/components/settings/__tests__/OpencodeGoTemperature.visual.fixture.tsx
Source excerpt: Register browser-owned stories in `playwright/gallery/stories.tsx` under a stable, descriptive ID and mount them with `mount(storyId, props)`.

📄 CodeRabbit inference engine (webview-ui/AGENTS.md)

Files:

  • webview-ui/playwright/gallery/stories.tsx
Source excerpt: Keep behavioral assertions in Vitest.

📄 CodeRabbit inference engine (webview-ui/AGENTS.md)

Files:

  • webview-ui/src/components/settings/__tests__/OpencodeGoTemperature.visual.tsx
📝 Summary

Summary by CodeRabbit

  • New Features
    • Temperature controls now reflect support for the selected OpenCode Go model and reasoning effort, including models that support temperature only with reasoning effort set to “none.”
    • Supported models can use custom temperature settings, including 0; saved settings are retained when a model or reasoning effort temporarily hides the control.
  • Bug Fixes
    • Requests now omit temperature when it isn’t supported for the selected model and reasoning effort.

OpenCode Go now resolves temperature support by model and reasoning effort. The settings UI reflects that support. Streaming and non-streaming Responses requests include a configured numeric temperature only when the capability rule allows it.

Changes: OpenCode Go temperature handling

Layer / File(s) Summary
Model capability registry and resolver
packages/types/src/providers/opencode-go.ts, packages/types/src/__tests__/opencode-go.test.ts, src/api/providers/fetchers/__tests__/opencode-go.spec.ts
The registry marks Grok and Muse Spark models as supporting temperature. GPT Luna models allow it only with reasoning effort "none". The resolver and tests cover these rules and live metadata merging.
Settings control visibility
webview-ui/src/components/settings/utils/temperatureSupport.ts, webview-ui/src/components/settings/ApiOptions.tsx, webview-ui/src/components/settings/utils/__tests__/temperatureSupport.spec.ts, webview-ui/src/components/settings/__tests__/ApiOptions.spec.tsx, webview-ui/src/components/settings/__tests__/OpencodeGoTemperature.visual.fixture.tsx, webview-ui/src/components/settings/__tests__/OpencodeGoTemperature.visual.tsx, webview-ui/playwright/gallery/stories.tsx
The settings helper uses effective reasoning effort and model capability to determine whether to show the temperature control. Tests cover model and reasoning-effort changes, saved values, and visual states.
Responses request temperature
src/api/providers/opencode-go.ts, src/api/providers/__tests__/opencode-go.spec.ts
Streaming and non-streaming Responses requests include a configured numeric temperature only when the resolver allows it. Tests cover supported values, including 0, and omission for unsupported or absent values.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant OpenCodeGoProvider
  participant TemperatureCapabilityResolver
  participant OpenCodeGoModelRegistry
  participant OpenCodeGoGateway
  OpenCodeGoProvider->>TemperatureCapabilityResolver: Check model and reasoning effort
  TemperatureCapabilityResolver->>OpenCodeGoModelRegistry: Read routing and temperature capability
  OpenCodeGoModelRegistry-->>TemperatureCapabilityResolver: Return model metadata
  TemperatureCapabilityResolver-->>OpenCodeGoProvider: Return support decision
  OpenCodeGoProvider->>OpenCodeGoGateway: Send Responses request with temperature when supported
Loading
Merge Risk: ⚪ Minimal · up to 56891

The temperature UI has behavior coverage and a committed visual baseline; no identified issue blocks merging.

Pre-merge checks: Passed 8
Check name Status Explanation
Title check Passed The title "feat(opencode-go): opt-in temperature for Responses models (#2055)" matches the main change: OpenCode Go Responses-format models now send temperature only for verified model and reasoning-e…
Description check Passed The description follows the repository template and is mostly complete. It explains the behavior, the per-model rules, the file-level implementation, and the test procedure. It links the related issue…
Linked Issues check Passed The changes satisfy the coding requirements in #2055. The OpenCode Go capability helper uses an opt-in model and effective-reasoning-effort rule. getResponsesTemperature() applies the rule in both s…
Out of Scope Changes check Passed The changed source files, tests, visual fixture, and gallery story support the #2055 request. They implement or verify OpenCode Go Responses temperature capability, request behavior, model metadata, a…
Regression Evidence Passed Focused regression coverage is present. The request tests cover streaming and non-streaming forwarding, supported and unsupported reasoning efforts, stale disabled reasoning, unset/null values, and ex…
Security Boundaries Passed No changed security-boundary violation is present. The new request path adds temperature only after typeof temperature === "number" and opencodeGoResponsesSupportsTemperature() accepts the exact…
Persistence Integrity Passed No changed persistence path meets the failure conditions. The PR changes request filtering and UI visibility only. getResponsesTemperature() reads the saved modelTemperature and omits it for unsup…
Lifecycle Resource Cleanup Passed No changed lifecycle path introduces a resource leak or duplicate work. The PR adds synchronous temperature capability checks and request-body fields. The Responses streaming path still passes the exi…
Full details: Title check

Explanation

The title "feat(opencode-go): opt-in temperature for Responses models (#2055)" matches the main change: OpenCode Go Responses-format models now send temperature only for verified model and reasoning-effort combinations. It names the provider, the feature, and the scope. The issue number suffix is harmless, and the title is a single, specific sentence.

Full details: Description check

Explanation

The description follows the repository template and is mostly complete. It explains the behavior, the per-model rules, the file-level implementation, and the test procedure. It links the related issues (Refs #2006, Closes #2055) and fills in the checklist and the visual snapshot N/A rationale. Minor gaps: the Test Procedure cites grok-4.7, which the rules do not cover, and the 'Get in Touch' and 'Videos' sections are filled in. The Description section uses some terms such as 'handler' and 'webview' without explanation. The author's own description also includes some non-Simplified Technical English phrasing, such as the parenthetical notes and the 'Observed varying degrees of performance' sentence, but this does not make the description incomplete.

Full details: Linked Issues check

Explanation

The changes satisfy the coding requirements in #2055. The OpenCode Go capability helper uses an opt-in model and effective-reasoning-effort rule. getResponsesTemperature() applies the rule in both streaming and non-streaming Responses requests and omits unset or unsupported values. The UI uses the same rule and preserves saved temperature settings. Tests cover model metadata, fetcher merging, request forwarding and omission, reasoning changes, and UI visibility. The existing 0–2 temperature control and its resolution remain unchanged.

Full details: Out of Scope Changes check

Explanation

The changed source files, tests, visual fixture, and gallery story support the #2055 request. They implement or verify OpenCode Go Responses temperature capability, request behavior, model metadata, and matching UI visibility. No unrelated product behavior or unrelated refactor is demonstrated.

Full details: Regression Evidence

Explanation

Focused regression coverage is present. The request tests cover streaming and non-streaming forwarding, supported and unsupported reasoning efforts, stale disabled reasoning, unset/null values, and explicit temperature 0. Type and UI helper tests cover registry capabilities, unknown/non-Responses models, model-info loading, provider boundaries, and effective effort changes. The fetcher merge has focused coverage. The durable settings change now has a Playwright component test, gallery story, and committed opencode-go-temperature.png baseline with supported and hidden states. Prior failure addressed: The PR now adds OpencodeGoTemperature.visual.tsx, its gallery story and fixture, plus the committed screenshots/opencode-go-temperature.png baseline. Existing ApiOptions Vitest coverage remains.

Full details: Security Boundaries

Explanation

No changed security-boundary violation is present. The new request path adds temperature only after typeof temperature === "number" and opencodeGoResponsesSupportsTemperature() accepts the exact Responses-model allowlist and approved effort mapping. Unknown and non-Responses model IDs return false. The UI uses the same allowlist rule. The changes do not expose secrets or PII, execute input, or bypass approval controls.

Full details: Persistence Integrity

Explanation

No changed persistence path meets the failure conditions. The PR changes request filtering and UI visibility only. getResponsesTemperature() reads the saved modelTemperature and omits it for unsupported configurations without modifying the stored value. ApiOptions passes the existing configuration through, and the added test verifies that switching reasoning effort causes no modelTemperature write while restoring the saved value when support returns. No new unawaited write, non-atomic persistence operation, rollback gap, or unpropagated persisted default is introduced.

Full details: Lifecycle Resource Cleanup

Explanation

No changed lifecycle path introduces a resource leak or duplicate work. The PR adds synchronous temperature capability checks and request-body fields. The Responses streaming path still passes the existing abort signal and closes its captured async iterator in finally via streamIterator.return?.() (src/api/providers/opencode-go.ts:431-491). The new UI helper and gallery fixture add no listeners, watchers, timers, providers, or tasks.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Review status

Thanks for contributing. This comment tracks the review sequence and the next action.

Current step: The required review sequence passed. Remaining merge requirements apply.

Review-state labels are managed by this workflow; do not edit them manually. community-approved is managed the same way — do not add or remove it manually. It signals a fresh community code approval for the current head as an advisory priority only; maintainer review is still required.

@codecov

codecov Bot commented Oct 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...rc/components/settings/utils/temperatureSupport.ts 88.88% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@github-actions github-actions Bot added coderabbit-review-active Required CI passed; CodeRabbit review is active awaiting-coderabbit Waiting for CodeRabbit to approve the latest commit labels Oct 24, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 24, 2026
@github-actions github-actions Bot added awaiting-maintainer CodeRabbit approved; waiting for a human maintainer and removed coderabbit-review-active Required CI passed; CodeRabbit review is active awaiting-coderabbit Waiting for CodeRabbit to approve the latest commit labels Oct 24, 2026
@github-actions github-actions Bot added coderabbit-review-active Required CI passed; CodeRabbit review is active awaiting-coderabbit Waiting for CodeRabbit to approve the latest commit and removed awaiting-maintainer CodeRabbit approved; waiting for a human maintainer labels Oct 24, 2026
@github-actions github-actions Bot added awaiting-maintainer CodeRabbit approved; waiting for a human maintainer and removed coderabbit-review-active Required CI passed; CodeRabbit review is active awaiting-coderabbit Waiting for CodeRabbit to approve the latest commit labels Oct 24, 2026

@taltas taltas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks clean to me, thanks for the contribution 🙌

@taltas
taltas added this pull request to the merge queue Oct 24, 2026
@github-actions github-actions Bot removed the awaiting-maintainer CodeRabbit approved; waiting for a human maintainer label Oct 24, 2026
Merged via the queue into Zoo-Code-Org:main with commit e879f8d Oct 24, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Support verified temperature capability for OpenCode Go Responses models

2 participants