Skip to content

fix(web): keep the default instance's draft model off custom instances - #13

Closed
matthias-scale wants to merge 1 commit into
upstream/2026-10-26-opencode-instance-draftfrom
fix/opencode-kimi-effort
Closed

matthias-scale wants to merge 1 commit into
upstream/2026-10-26-opencode-instance-draftfrom
fix/opencode-kimi-effort

Conversation

@matthias-scale

Copy link
Copy Markdown
Owner

What broke

An OpenCode provider instance limited to one provider (here a Kimi-only instance, kimi_api) could show a model from the default opencode instance. Both lists have a "Kimi K3.1 Pro", so it looked right. But the slug was opencode-go/kimi-k3.1-pro, which is not in the Kimi instance's list.

The result:

  • The composer marked the model unavailable, so it hid the Reasoning (effort) control. That only happens for OpenCode, in TraitsPicker.getSelectedTraits.
  • A send would have asked the Kimi-only OpenCode server for a provider it has turned off.

Why

deriveEffectiveComposerModelState falls back to the draft saved under the driver kind (modelSelectionByProvider["opencode"]) when the selected instance has none. Those driver-keyed drafts are older than instances and belong to the default instance. Only Antigravity skipped the fallback for custom instances.

Fix

Use the default-instance check for every driver. A custom instance with no draft now falls through to its own default model.

Evidence

  • New test keeps the default instance's draft model off a custom instance of the same driver: fails before the fix, passes after.
  • apps/web: 4125 tests pass; tsc --noEmit passes; vp fmt and vp lint are clean.
  • Live check: the running kimi_api OpenCode server reports variants for k3.1-pro (low/high/max), and T3's server catalog passes them on, so the server side was fine.

A custom provider instance with no draft of its own fell back to the
draft stored under its driver kind, which belongs to the default
instance. Only Antigravity was exempt. An OpenCode instance limited to
one provider (for example a Kimi-only instance) then showed a model from
the default OpenCode instance: same label, but a slug missing from its
own catalog. The composer treated it as unavailable, hid the reasoning
control, and would have sent the foreign slug to that instance's server.

Apply the default-instance check to every driver.
@matthias-scale

Copy link
Copy Markdown
Owner Author

Superseded by upstream pingdotgg#25511 (same commit).

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.

1 participant