Skip to content

fix: support model #variants in OpenCode V2 reviewer sessions - #101

Merged
dyoshikawa merged 7 commits into
dyoshikawa:mainfrom
thisfilipe:fix/reviewer-model-variant-v2
Nov 6, 2026
Merged

dyoshikawa merged 7 commits into
dyoshikawa:mainfrom
thisfilipe:fix/reviewer-model-variant-v2

Conversation

@thisfilipe

@thisfilipe thisfilipe commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #100.

This PR adds support for OpenCode model variants in the V2 agent reviewer, allowing users to configure reasoning effort through the standard #variant syntax.

Previously, the reviewer passed modelID directly to the V2 session API, which expects the model ID and variant as separate properties.

Changes

  • Update toModelRef() to split an optional #variant suffix and pass it as a separate property.
  • Update fromModelRef() to preserve the originating session's selected variant when the reviewer inherits its model.
  • Add regression tests covering explicitly configured and inherited variants.
  • Document variant configuration and the OpenCode V1 limitation in the README.

Example

The following configuration is now supported on V2:

{
  "reviewer": {
    "agent": {
      "model": {
        "providerID": "opencode-go",
        "modelID": "deepseek-v4.1-flash#low"
      }
    }
  }
}

The plugin translates it into:

{
  "providerID": "opencode-go",
  "id": "deepseek-v4.1-flash",
  "variant": "low"
}

Compatibility

  • Existing model configurations without variants remain unchanged.
  • The change is limited to the OpenCode V2 session adapter.
  • OpenCode V1 and external SDK runtimes retain their existing behavior.
  • No new configuration property is required.

Testing

  • Added regression test for explicitly configured model variants.
  • Added regression test for inherited session variants.
  • Verified the diff is isolated from unrelated fork changes.
  • Run the test suite and type checks.
  • Confirm behavior in a live OpenCode V2 session.
  • Review CI results.

References

@thisfilipe
thisfilipe marked this pull request as ready for review November 5, 2026 21:44
@dyoshikawa
dyoshikawa merged commit 9b00c9c into dyoshikawa:main Nov 6, 2026
1 check 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.

OpenCode V2 reviewer does not support model variants (#low, #medium, #high)

2 participants