fix(auxiliary): prefer fallback_providers model for OpenRouter aux tasks#25180
fix(auxiliary): prefer fallback_providers model for OpenRouter aux tasks#25180Kewe63 wants to merge 1 commit into
Conversation
When the user has configured fallback_providers with an OpenRouter entry that specifies a model (e.g. :free variants), auxiliary tasks now use that model instead of the hardcoded paid default. Previously _try_openrouter() always returned google/gemini-3-flash-preview for auxiliary tasks, causing unexpected billing for free-tier users who configured only :free models in their fallback chain. Fixes NousResearch#24029
|
Constructive review — this closes the billing half of #24029, but I think it leaves a gap (and, for a common config, can relocate the silent-substitution problem rather than fix it). What the PR does well
Gap 1 — meta-routers aren't concrete modelsThe method returns the first A very common reliability config is: With this PR, Gap 2 — the disclosure half of #24029 is still openThe issue's expected behavior included: "at minimum, log a clear warning that a paid/substitute model is being used." This PR adds no such surfacing — the only log on this path is a generic Evidence that the substitution is invisibleI hit the same Run record (declared at session start): Per-call records (
All 6 calls ran on Suggested adjustments
|
Problem
Users who configure only OpenRouter
:freemodels infallback_providersstill get billed because auxiliary tasks (title_generation, compression, vision) hardcodegoogle/gemini-3-flash-preview(a paid model).Root Cause
_try_openrouter()always returns_OPENROUTER_MODELregardless of the user'sfallback_providersconfiguration.Fix
Added
_resolve_openrouter_aux_model()which checks the user'sfallback_providersfor an OpenRouter entry with an explicit model. If found, that model is used for auxiliary tasks. Otherwise falls back to the hardcoded default.Fixes #24029