Skip to content

fix(opencode-go): add MiMo V2.6 Flash and Pro model configurations - #2246

Merged
edelauna merged 1 commit into
Zoo-Code-Org:mainfrom
myk1yt:fix/opencode-go-mimo-v2.6-metadata
Oct 31, 2026
Merged

edelauna merged 1 commit into
Zoo-Code-Org:mainfrom
myk1yt:fix/opencode-go-mimo-v2.6-metadata

Conversation

@myk1yt

@myk1yt myk1yt commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds mimo-v2.6-flash and mimo-v2.6-pro to the curated OpenCode Go registry in packages/types. Both IDs are served by the live Go catalog but were uncurated, so the fetcher fell back to the generic 200,000-token context / 32,768-token output, no image support, no pricing, and no reasoning preservation.

Fixes #1997

What changes

  • packages/types/src/providers/opencode-go.ts: two registry entries, 24 lines, no other production change.
  • packages/types/src/__tests__/opencode-go.test.ts: both IDs added to the OpenAI-format list and to the table-driven getOpencodeGoModelInfo assertions.
  • src/api/providers/fetchers/__tests__/opencode-go.spec.ts: both IDs added to the catalog-completeness array, plus a new ID-only resolution test proving the native registry wins over the generic fallback.
  • src/api/providers/__tests__/opencode-go.spec.ts: one provider regression test proving the reasoning -> tool_call -> tool_result history survives on the wire for mimo-v2.6-flash.

Routing is unchanged. Both models stay on Chat Completions, which is the default "openai" format, so neither routing set is touched.

Metadata and where each number comes from

Both sources below were fetched on 2026-10-30 and agree on every value.

Field Flash Pro Source
contextWindow 1,048,576 1,048,576 live catalog limit.context
maxTokens 131,072 131,072 live catalog limit.output
supportsImages true true live catalog modalities.input lists text, image (jpeg/png/gif/webp/bmp), audio, video
inputPrice 0.14 0.435 live catalog cost.text.input.price; Go pricing table
outputPrice 0.28 0.87 live catalog cost.text.output.price; Go pricing table
cacheReadsPrice 0.0028 0.003625 live catalog cost.text.input.cache.read; Go pricing table
supportsPromptCache false false matches the existing MiMo Go entries and the dedicated mimo provider: no client-side cache_control on the Chat Completions path, while the server-side cache read is still priced
preserveReasoning true true Xiaomi's deep-thinking guide requires the reasoning to be passed back on tool-call continuations

Sources:

  • Live Go catalog, https://opencode.ai/zen/go/v1/models (HTTP 200, 28 models), retrieved 2026-10-30. This is the same endpoint src/api/providers/fetchers/opencode-go.ts calls.
  • Official Go docs, https://opencode.ai/docs/go/, retrieved 2026-10-30. The usage-limits table lists MiMo-V2.6-Flash $0.14 / $0.28 / $0.0028 and MiMo-V2.6-Pro $0.435 / $0.87 / $0.003625; the endpoints table assigns both to /openai/v1/chat/completions.

Two things were deliberately not copied from the V2.5 entries:

  • longContextPricing. The live catalog emits no cost.*.overrides for either V2.6 ID, so there is no long-context tier to model. mimo-v2.5 and mimo-v2.5-pro both carry one; these entries do not.
  • supportsImages: false from mimo-v2.5-pro. The live catalog advertises image input for V2.6 Pro, so the V2.5 Pro value would be wrong here. This is the trap issue OpenCode Go: add MiMo V2.6 Flash and Pro model configurations #1997 warns about.

No cache-write rate is declared, and no direct Xiaomi pay-as-you-go price is used.

Precedent

This follows the merged shape of #1659 (fix(opencode-go): add DeepSeek V4.1 Flash metadata, merged 2026-10-02, +45/-0 across the same three files): registry entry plus registry-suite assertions plus fetcher-suite resolution coverage. The provider regression test is the additional coverage issue #1997 asks for.

Validation

  • packages/types OpenCode Go suite: 53 passed.
  • OpenCode Go fetcher suite: 23 passed.
  • OpenCode Go provider suite: 125 passed.
  • pnpm --dir src run check-types: passed.
  • ESLint on all four touched files with --max-warnings=0: passed, and src/eslint-suppressions.json is unchanged (verified semantically: 338 keys, 0 value differences).
  • Mutation budget measured from the committed blobs with scripts/stryker-diff.mjs's own buildManifest: 24 changed executable lines in packages/types against a 500-line limit, 0 in src (test paths are excluded from mutation testing).

No changeset and no CHANGELOG.md edit, per AGENTS.md.

Scope

Only the two MiMo V2.6 IDs named by #1997. The separate direct MiMo provider (#1761 / #1748) is untouched, the Go default model is unchanged, and no ultraspeed support is added.

What: add mimo-v2.6-flash and mimo-v2.6-pro to the curated OpenCode Go
registry in packages/types, with their own context/output limits, input
modalities, reasoning preservation, and Go pricing.

Why: both IDs are served by the live Go catalog but were uncurated, so the
fetcher fell back to 200,000 context / 32,768 output, no image support, no
pricing, and no reasoning preservation. Issue Zoo-Code-Org#1997 asks for independently
confirmed V2.6 metadata rather than a copy of the V2.5 limits.

Impact: the two models now report 1,048,576 context / 131,072 output, accept
image input, preserve reasoning across tool-call continuations, and price at
0.14/0.28/0.0028 (Flash) and 0.435/0.87/0.003625 (Pro) per 1M tokens. Routing
is unchanged: both stay on Chat Completions. No other model is affected.

Fixes Zoo-Code-Org#1997
@coderabbitai

coderabbitai Bot commented Oct 30, 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 159c42e and 9f0b344.

Files selected for processing: 4
  • packages/types/src/__tests__/opencode-go.test.ts
  • packages/types/src/providers/opencode-go.ts
  • src/api/providers/__tests__/opencode-go.spec.ts
  • src/api/providers/fetchers/__tests__/opencode-go.spec.ts

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
Path-based instructions: 6
Treat model, provider, MCP, path, command, and tool data as untrusted.

CodeRabbit configuration file

Files:

  • src/api/providers/__tests__/opencode-go.spec.ts
  • src/api/providers/fetchers/__tests__/opencode-go.spec.ts
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:

  • packages/types/src/__tests__/opencode-go.test.ts
  • packages/types/src/providers/opencode-go.ts
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:

  • src/api/providers/__tests__/opencode-go.spec.ts
  • packages/types/src/__tests__/opencode-go.test.ts
  • src/api/providers/fetchers/__tests__/opencode-go.spec.ts
Check strict typing and exhaustive behavior across normal, boundary, error, cancellation, retry, and compatibility paths.

CodeRabbit configuration file

Files:

  • src/api/providers/__tests__/opencode-go.spec.ts
  • packages/types/src/__tests__/opencode-go.test.ts
  • src/api/providers/fetchers/__tests__/opencode-go.spec.ts
  • packages/types/src/providers/opencode-go.ts
Verify extension/webview contracts, cancellation and error propagation, VS Code lifecycle correctness, and behavior under retries and partial failure.

CodeRabbit configuration file

Files:

  • src/api/providers/__tests__/opencode-go.spec.ts
  • src/api/providers/fetchers/__tests__/opencode-go.spec.ts
Act as an adversarial second-opinion reviewer.

CodeRabbit configuration file

Files:

  • src/api/providers/__tests__/opencode-go.spec.ts
  • packages/types/src/__tests__/opencode-go.test.ts
  • src/api/providers/fetchers/__tests__/opencode-go.spec.ts
  • packages/types/src/providers/opencode-go.ts
GitHub Check: mutation-diff
packages/types/src/providers/opencode-go.ts

[warning] 301-301: Mutation test advisory
packages/types/src/providers/opencode-go.ts:301: Survived StringLiteral mutant (replacement: ""). See the job summary for the complete list and resolution guidance.

[warning] 289-289: Mutation test advisory
packages/types/src/providers/opencode-go.ts:289: Survived StringLiteral mutant (replacement: ""). See the job summary for the complete list and resolution guidance.

📝 Summary

Summary by CodeRabbit

  • New Features
    • Added MiMo V2.6 Flash and Pro to the OpenCode Go model catalog, with their supported capabilities, token limits, and pricing.
  • Bug Fixes
    • Improved handling of tool-call continuations that include assistant reasoning, preserving conversation details in outgoing requests.
    • Ensured catalog entries for both models use accurate model information when responses provide only model IDs.

The OpenCode Go registry adds MiMo V2.6 Flash and Pro with curated limits, capabilities, and pricing. Tests cover catalog resolution and reasoning preservation in a tool-call continuation.

Changes: OpenCode Go MiMo V2.6 support

Layer / File(s) Summary
Model metadata and catalog resolution
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 adds both models with a 1,048,576-token context window, 131,072 output-token limit, image support, reasoning preservation, and model-specific input, output, and cache-read prices. Tests cover registry metadata and ID-only catalog responses.
Reasoning in tool-call continuations
src/api/providers/__tests__/opencode-go.spec.ts
A provider test checks that a request for MiMo V2.6 Flash retains assistant reasoning and tool-call history, including the tool result and trailing environment details.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related issues

  • Issue 1891: The registry enables reasoning preservation for both models, and the provider test checks reasoning retention through a tool-call continuation.
Merge Risk: Minimal · up to 9f0b3

The changes add both MiMo V2.6 models with targeted regression coverage. No actionable merge-blocking issue is identified; merge after normal checks pass.

Pre-merge checks: Passed 7 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Regression Evidence Warning The positive metadata and tool-call coverage is focused, but it does not cover two deliberate unset behaviors. The new registry entries at packages/types/src/providers/opencode-go.ts:279-302 omit bo… Add focused negative assertions for both mimo-v2.6-flash and mimo-v2.6-pro in the registry invariant cases: assert cacheWritesPrice and longContextPricing are undefined (or use not.toHaveProperty). Keep the existing ID-only fetche…
Passed Passed checks: 7 passed
Check name Status Explanation
Title check Passed The title clearly identifies the primary change: adding MiMo V2.6 Flash and Pro configurations to OpenCode Go.
Description check Passed The description links issue #1997, explains the implementation and scope, documents metadata sources, and provides detailed validation results. It does not use every template heading, such as the pre-…
Linked Issues check Passed The PR satisfies the coding requirements in #1997. The registry adds both IDs with 1,048,576 context, 131,072 output, image support, reasoning preservation, no prompt-cache support, and the reported G…
Out of Scope Changes check Passed The whole-PR diff contains only the two #1997 registry entries and related registry, fetcher, and provider tests. It does not change the direct MiMo provider, the Go default model, ultraspeed support,…
Security Boundaries Passed No changed path meets the security failure conditions. The only production change adds static metadata entries for mimo-v2.6-flash and mimo-v2.6-pro in `packages/types/src/providers/opencode-go.ts…
Persistence Integrity Passed No changed persistence path exists. The PR adds two in-memory entries to opencodeGoModels and test coverage in three test files. The diff contains no persistence writes, storage operations, rollback…
Lifecycle Resource Cleanup Passed No changed lifecycle path exists. The pull request adds two static ModelInfo registry entries and test cases only; it does not add or alter listeners, watchers, providers, timers, tasks, cancellatio…
Full details: Description check

Explanation

The description links issue #1997, explains the implementation and scope, documents metadata sources, and provides detailed validation results. It does not use every template heading, such as the pre-submission checklist and contact section, but it contains the required core information.

Full details: Linked Issues check

Explanation

The PR satisfies the coding requirements in #1997. The registry adds both IDs with 1,048,576 context, 131,072 output, image support, reasoning preservation, no prompt-cache support, and the reported Go input/output/cache-read prices. The diff does not add long-context or cache-write pricing. The provider uses the default OpenAI Chat Completions path for these IDs, and the new provider test verifies reasoning, tool-call, and tool-result history on the wire. Registry and fetcher tests cover both IDs and ID-only catalog resolution. The reported focused suites and type checks pass.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff contains only the two #1997 registry entries and related registry, fetcher, and provider tests. It does not change the direct MiMo provider, the Go default model, ultraspeed support, or routing configuration. No unrelated production change is present.

Full details: Security Boundaries

Explanation

No changed path meets the security failure conditions. The only production change adds static metadata entries for mimo-v2.6-flash and mimo-v2.6-pro in packages/types/src/providers/opencode-go.ts; it adds no secret, PII, input execution, or approval/allowlist bypass. The other three changed files contain tests only. Existing fetcher validation still requires a string model ID, and existing handler logic uses the metadata to select message conversion without executing model-supplied input.

Full details: Persistence Integrity

Explanation

No changed persistence path exists. The PR adds two in-memory entries to opencodeGoModels and test coverage in three test files. The diff contains no persistence writes, storage operations, rollback logic, or persisted defaults. The fetcher only reads the registry through getOpencodeGoModelInfo, so the stated persistence failure conditions are not introduced.

Full details: Lifecycle Resource Cleanup

Explanation

No changed lifecycle path exists. The pull request adds two static ModelInfo registry entries and test cases only; it does not add or alter listeners, watchers, providers, timers, tasks, cancellation handling, disposal, restart logic, or resource ownership. Therefore it introduces no concrete cleanup leak or post-cancellation duplicate work.

Full details: Regression Evidence

Explanation

The positive metadata and tool-call coverage is focused, but it does not cover two deliberate unset behaviors. The new registry entries at packages/types/src/providers/opencode-go.ts:279-302 omit both longContextPricing and cacheWritesPrice. The added registry and fetcher tests only assert the populated fields at packages/types/src/__tests__/opencode-go.test.ts:367-390 and src/api/providers/fetchers/__tests__/opencode-go.spec.ts:366-385; they do not assert either property is absent. This omission is behaviorally relevant: src/shared/cost.ts:9-12 skips long-context multipliers when unset, and its cache-write calculation treats an unset write price as zero. Copying the V2.5 pricing fields would therefore pass the current new tests while changing billing behavior.

Resolution

Add focused negative assertions for both mimo-v2.6-flash and mimo-v2.6-pro in the registry invariant cases: assert cacheWritesPrice and longContextPricing are undefined (or use not.toHaveProperty). Keep the existing ID-only fetcher assertions, and optionally repeat the absence checks there to protect the parsed metadata contract.

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 30, 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 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 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 30, 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 30, 2026
@github-actions github-actions Bot added community-approved Fresh community approval on the current head; maintainer review still required and removed awaiting-maintainer CodeRabbit approved; waiting for a human maintainer community-approved Fresh community approval on the current head; maintainer review still required labels Oct 30, 2026
@edelauna
edelauna added this pull request to the merge queue Oct 31, 2026
Merged via the queue into Zoo-Code-Org:main with commit 71a21c2 Oct 31, 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.

OpenCode Go: add MiMo V2.6 Flash and Pro model configurations

3 participants