fix(fallback): forward custom_providers to fallback model context-length detection
The same root cause as the auxiliary compression fix (commit 7becb19): get_model_context_length() is called without custom_providers, so per-model context_length overrides are silently skipped. The fallback activation path (_try_activate_fallback) had the same missing parameter. When the agent switches to a fallback provider, the fallback model would use the models.dev value (e.g. 204800 for NVIDIA NIM minimax-m2.7) instead of the user-configured one in custom_providers (e.g. 196608) — a subtle discrepancy that could cause the fallback model to run with an incorrect context window, leading to truncated messages or failed API requests when the model does not support the detected length. Fix: pass self._custom_providers to get_model_context_length() so the fallback path sees the same per-model overrides as the main model path.
This commit is contained in:
parent
903ac23bc8
commit
21078ebcea
@ -9187,6 +9187,7 @@ class AIAgent:
|
||||
self.model, base_url=self.base_url,
|
||||
api_key=self.api_key, provider=self.provider,
|
||||
config_context_length=getattr(self, "_config_context_length", None),
|
||||
custom_providers=self._custom_providers,
|
||||
)
|
||||
self.context_compressor.update_model(
|
||||
model=self.model,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user