fix(vision): route image analysis through active thread model - #37028
fix(vision): route image analysis through active thread model#37028chromalinx wants to merge 1 commit into
Conversation
Pass the active provider/model through tool dispatch so vision_analyze can follow the current conversation backend instead of forcing the auxiliary vision task defaults. This keeps gateway thread model switches consistent for image analysis while preserving explicit model/provider overrides. * model_tools.handle_function_call accepts and forwards provider/model kwargs to registry.dispatch. * AIAgent._tool_routing_kwargs() centralises the `provider=self.provider or None, model=self.model or None` triple that previously appeared at every _invoke_tool call site. * tools/vision_tools.vision_analyze_tool accepts a new `provider` parameter and threads it into the async_call_llm call_kwargs. * _handle_vision_analyze extracts provider/model from `**kw` so the agent's active thread backend reaches the tool. A regression test (tests/tools/test_vision_thread_routing.py) covers provider/model pass-through, kwargs extraction, and the AUXILIARY_VISION_MODEL fallback.
|
@alt-glitch Closed and recreated because the old branch had picked up unrelated changes from a local WIP branch (voice-module) — the diff was 2200+ files and unmergeable in any clean form. The new branch is rebased directly on main and contains only the vision routing changes. The core idea is the same, but the review surface is now 4 files / +150 lines instead of 2200 files. Let me know if you spot anything from #27015 that this PR regressed. |
|
@alt-glitch gentle ping — addressed all feedback. Branch rebased on current main, only the 2 files needed (tools/vision_tool.py + tests/vision/). Original #27015 closed because the old branch had picked up unrelated WIP. No bundling. Test fixes pushed to the PR branches. Happy to rebase/adjust if anything still blocks merge. |
|
Thanks for the focused follow-up and the regression coverage. Automated hermes-sweeper review found this behavior is already implemented on current
The PR's dispatcher-based patch no longer applies after the subsequent tool-execution and vision refactors. Closing as implemented on main. |
What this PR does
Passes the active provider/model through tool dispatch so
vision_analyzefollows the current conversation backend instead of forcing the auxiliary vision task defaults. Keeps gateway thread model switches consistent for image analysis while preserving explicit model/provider overrides.Changes
model_tools.handle_function_callaccepts and forwardsprovider/modelkwargs toregistry.dispatch.AIAgent._tool_routing_kwargs()centralises theprovider=self.provider or None, model=self.model or Nonetriple that previously appeared at every_invoke_toolcall site.tools/vision_tools.vision_analyze_toolaccepts a newproviderparameter and threads it into theasync_call_llmcall_kwargs._handle_vision_analyzeextractsprovider/modelfrom**kwso the agent's active thread backend reaches the tool.A regression test (
tests/tools/test_vision_thread_routing.py) covers provider/model pass-through, kwargs extraction, and theAUXILIARY_VISION_MODELfallback.4 files changed, +150 / -2.