[PR #8724] fix: remove opencode fallback in getSmallModel #12841

Open
opened 2026-02-16 18:17:44 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/8724

State: open
Merged: No


Summary

  • Removes the automatic fallback to OpenCode's gpt-5-nano when no small model is found for the user's provider
  • Now returns undefined, allowing callers to fall back to the user's main model as documented

Problem

The getSmallModel function was falling back to OpenCode's gpt-5-nano even when users had their own provider configured (e.g., Anthropic, OpenAI). This contradicted the documentation which states the small model "falls back to your main model."

Users who set up their own provider expected their configured model to be used, not OpenCode's gpt-5-nano.

Solution

Removed the OpenCode provider fallback (lines 1144-1148). The callers already handle undefined correctly:

  • prompt.ts:1750: getSmallModel(...) ?? getModel(providerID, modelID)
  • summary.ts:86: getSmallModel(...) ?? ...

This ensures the documented behavior: when no small model is configured or found, it falls back to the user's main model.

Fixes #8609

Test plan

  • Configure a non-OpenCode provider (e.g., Anthropic)
  • Do not configure small_model in config
  • Use a feature that triggers getSmallModel (e.g., summarization)
  • Verify it uses a model from the configured provider, not OpenCode's gpt-5-nano

🤖 Generated with Claude Code

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/8724 **State:** open **Merged:** No --- ## Summary - Removes the automatic fallback to OpenCode's `gpt-5-nano` when no small model is found for the user's provider - Now returns `undefined`, allowing callers to fall back to the user's main model as documented ## Problem The `getSmallModel` function was falling back to OpenCode's `gpt-5-nano` even when users had their own provider configured (e.g., Anthropic, OpenAI). This contradicted the documentation which states the small model "falls back to your main model." Users who set up their own provider expected their configured model to be used, not OpenCode's `gpt-5-nano`. ## Solution Removed the OpenCode provider fallback (lines 1144-1148). The callers already handle `undefined` correctly: - `prompt.ts:1750`: `getSmallModel(...) ?? getModel(providerID, modelID)` - `summary.ts:86`: `getSmallModel(...) ?? ...` This ensures the documented behavior: when no small model is configured or found, it falls back to the user's main model. Fixes #8609 ## Test plan - [ ] Configure a non-OpenCode provider (e.g., Anthropic) - [ ] Do not configure `small_model` in config - [ ] Use a feature that triggers `getSmallModel` (e.g., summarization) - [ ] Verify it uses a model from the configured provider, not OpenCode's `gpt-5-nano` 🤖 Generated with [Claude Code](https://claude.com/claude-code)
yindo added the pull-request label 2026-02-16 18:17:44 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12841