fix(fallback): forward custom_providers to fallback model context-length detection

Original commit 21078ebce by PaTTeeL targeted _try_activate_fallback in
pre-refactor run_agent.py. The body now lives in
agent/chat_completion_helpers.try_activate_fallback — re-applied there.

Co-authored-by: PaTTeeL <9150277+PaTTeeL@users.noreply.github.com>
This commit is contained in:
teknium1
2026-05-16 23:42:16 -07:00
parent 4ab9a06a51
commit b5bcffe167
+1
View File
@@ -850,6 +850,7 @@ def try_activate_fallback(agent, reason: "FailoverReason | None" = None) -> bool
agent.model, base_url=agent.base_url,
api_key=agent.api_key, provider=agent.provider,
config_context_length=getattr(agent, "_config_context_length", None),
custom_providers=agent._custom_providers,
)
agent.context_compressor.update_model(
model=agent.model,