fix(provider): respect configured small_model and add opencode handling to smallOptions#31092
Open
lexlian wants to merge 1 commit into
Open
fix(provider): respect configured small_model and add opencode handling to smallOptions#31092lexlian wants to merge 1 commit into
lexlian wants to merge 1 commit into
Conversation
…ng to smallOptions Closes anomalyco#31042 Two compounding bugs caused the symptoms in anomalyco#31042: 1. When cfg.small_model is configured but the model is not in the provider catalog, getSmallModel silently returned undefined and the caller fell back to the main model with no indication to the user. Added a warning log so users know their config was ignored. The fallback behavior itself matches the documented design (per anomalyco#14807 and the changelog: "Invalid small_model config no longer poisons fallback paths"). 2. smallOptions() in transform.ts was missing opencode provider handling — only openai, openrouter/llmgateway, and venice were handled. For opencode models it returned an empty options object, causing the opencode API call to fail/behave unexpectedly and trigger LLM retries (the 90s delay users reported). Added the same include and reasoningSummary that options() already sets for opencode models, scoped to the small-model call path.
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #31042
Type of change
What does this PR do?
Two bugs cause the symptoms in #31042:
Bug 1 — silent fallback in
getSmallModel. Whensmall_modelis configured but the model isn't in the provider catalog, the function returnsundefinedand the title agent silently uses the main model. The fallback behavior is correct (per the documented design and the changelog: "Invalid small_model config no longer poisons fallback paths"), but the user has no way to know their config was ignored. The fix adds aWARNlog inside thecatchTaghandler so users see why.Bug 2 —
smallOptionsmissing opencode handling. When the title agent calls the LLM withsmall: truefor an opencode provider model,smallOptionsreturned{}because it only handledopenai,openrouter/llmgateway, andvenice. The opencode API call was missing theincludeandreasoningSummaryoptions thatoptions()already sets for opencode, so the request would fail/behave unexpectedly, and the LLM runtime would retry — that's the ~90s delay users reported. The fix adds the same opencode options tosmallOptions, scoped to the small-model call path.Related: #8609 (misleading docs), #14807 (silent failure), #30662 (smallOptions missing opencode).
How did you verify your code works?
To verify the warning manually: set
small_model: "opencode/some-invalid-model"in your config, start a session, and you should see aWARNlineconfigured small_model not found, falling back to main modelin the logs.Screenshots / recordings
N/A — no UI change.
Checklist