fix(agent): plumb main_runtime through vision aux resolution#19470
Closed
konsisumer wants to merge 1 commit into
Closed
fix(agent): plumb main_runtime through vision aux resolution#19470konsisumer wants to merge 1 commit into
konsisumer wants to merge 1 commit into
Conversation
Vision auxiliary tasks (analyze_image, vision-aware tools) resolved their provider via _read_main_provider() / _read_main_model() — the config-only path. After a /model switch or fallback activation, the main loop picked up the new provider/model from self._client_kwargs but vision tasks kept hitting the original provider from config. resolve_vision_provider_client() now accepts main_runtime and prefers its provider/model in the auto branch. call_llm() and async_call_llm() forward the kwarg they already accept (async_call_llm previously had no main_runtime parameter at all — now matches sync parity). Refs NousResearch#19437.
Contributor
Author
|
Closing: superseded_by_other_pr. other PRs claim to close same issues: [(19437, 19485)] autocontrib · housekeeping · 2026-05-04T03:29:31Z |
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.
Vision auxiliary tasks diverged from the main agent runtime after
/modelswitches or fallback activations becauseresolve_vision_provider_client()resolved through_read_main_provider()/_read_main_model()— the config-only path — even when the caller had a live runtime snapshot.What changed and why
resolve_vision_provider_client()accepts an optionalmain_runtimeand uses it in the auto branch before falling back to config (agent/auxiliary_client.py).call_llm(task="vision", ...)forwards its existingmain_runtimekwarg into the vision resolver and into the auth-error retry path.async_call_llm()gains amain_runtimeparameter (parity withcall_llm) and forwards it to both the vision resolver and_get_cached_client(including the auto fallback and auth-error retry).resolve_vision_provider_clientlisted under "Affected Code Paths").How to test
pytest tests/agent/test_auxiliary_main_first.py -q— covers existing main-first behaviour plus two new regression tests:test_runtime_override_wins_over_config_for_vision— runtime provider wins over config in the vision auto branch.test_call_llm_vision_forwards_main_runtime—call_llm(task="vision")reachesresolve_vision_provider_clientwithmain_runtimeintact.pytest tests/agent tests/run_agent tests/tools/test_web_tools_config.py -q— full auxiliary + run_agent coverage stays green (the only failures are pre-existing onmain:tests/agent/test_anthropic_adapter.py::TestRunOauthSetupToken::*andtests/run_agent/test_concurrent_interrupt.py).What platforms tested on
Fixes #19437