Summary
The knn routing backend routes calls to per-model endpoints through PerModelProvider, but the per-model sub-providers it builds never receive .generation. As a result, the configured agents.defaults.temperature / max_tokens / reasoning_effort are silently ignored for any call that routes to a knn endpoint; those calls fall back to the hardcoded GenerationSettings() defaults (temperature=0.7, max_tokens=4096).
Introduced by #163 (opt-in knn backend). Off by default, so impact is limited to users who set routing.enabled=true and routing.backend=knn.
Mechanism
- Generation defaults reach a call via
chat_with_retry, which reads self.generation.{temperature,max_tokens,reasoning_effort} and injects them into chat() (raven/providers/base.py:516-521). The low-level chat() itself does not read self.generation.
- On the normal path,
make_provider sets provider.generation from config (raven/cli/_helpers.py:134), so the values reach calls.
- On the knn path,
PerModelProvider.__init__ builds one CustomProvider per model with only api_key / api_base / default_model and never assigns .generation (raven/providers/per_model_provider.py:23-30). PerModelProvider.chat_with_retry delegates to the sub-provider (per_model_provider.py:49), whose .generation is the default, so the configured values are lost.
gateway_commands.py:50 also never sets .generation on the PerModelProvider itself.
Impact
- knn-routed calls ignore user-configured
temperature / max_tokens / reasoning_effort.
- Low severity: knn is opt-in and off by default (
routing.enabled=false, routing.backend=ecoclaw).
Fix
PerModelProvider should inherit the fallback provider's .generation and propagate it to the per-model sub-providers (the fallback is already configured by make_provider before knn wrapping at gateway_commands.py:196):
# in PerModelProvider.__init__, after building self._by_model
self.generation = fallback.generation
for sub in self._by_model.values():
sub.generation = self.generation
Note
This same wiring gap also blocks the configurable llm_call_timeout proposed in #150 from reaching knn endpoints. The #150 fix will apply the 3-line propagation above as a side effect, which incidentally corrects the temperature / max_tokens loss described here. Filing this separately to record the root cause; the cross-reference on #163 keeps attribution clear.
Related: #150, #163.
Summary
The
knnrouting backend routes calls to per-model endpoints throughPerModelProvider, but the per-model sub-providers it builds never receive.generation. As a result, the configuredagents.defaults.temperature/max_tokens/reasoning_effortare silently ignored for any call that routes to a knn endpoint; those calls fall back to the hardcodedGenerationSettings()defaults (temperature=0.7,max_tokens=4096).Introduced by #163 (opt-in knn backend). Off by default, so impact is limited to users who set
routing.enabled=trueandrouting.backend=knn.Mechanism
chat_with_retry, which readsself.generation.{temperature,max_tokens,reasoning_effort}and injects them intochat()(raven/providers/base.py:516-521). The low-levelchat()itself does not readself.generation.make_providersetsprovider.generationfrom config (raven/cli/_helpers.py:134), so the values reach calls.PerModelProvider.__init__builds oneCustomProviderper model with onlyapi_key/api_base/default_modeland never assigns.generation(raven/providers/per_model_provider.py:23-30).PerModelProvider.chat_with_retrydelegates to the sub-provider (per_model_provider.py:49), whose.generationis the default, so the configured values are lost.gateway_commands.py:50also never sets.generationon thePerModelProvideritself.Impact
temperature/max_tokens/reasoning_effort.routing.enabled=false,routing.backend=ecoclaw).Fix
PerModelProvidershould inherit the fallback provider's.generationand propagate it to the per-model sub-providers (the fallback is already configured bymake_providerbefore knn wrapping atgateway_commands.py:196):Note
This same wiring gap also blocks the configurable
llm_call_timeoutproposed in #150 from reaching knn endpoints. The #150 fix will apply the 3-line propagation above as a side effect, which incidentally corrects thetemperature/max_tokensloss described here. Filing this separately to record the root cause; the cross-reference on #163 keeps attribution clear.Related: #150, #163.