fix(vision): route image analysis through active thread model - #27015
Closed
chromalinx wants to merge 2 commits into
Closed
fix(vision): route image analysis through active thread model#27015chromalinx wants to merge 2 commits into
chromalinx wants to merge 2 commits 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.
Collaborator
This comment was marked as spam.
This comment was marked as spam.
- Remove dead contextvars code (_thread_provider, _thread_model) The variables were declared but never .set() by any caller, making the entire mechanism a no-op. Clean up the import, declarations, and the dead fallback branch inside async_call_llm. - Restore task='vision' for per-task config resolution Without it _resolve_task_provider_model() and _get_task_extra_body() miss vision-specific overrides (temperature, extra_body) from config.yaml. - Extract _tool_routing_kwargs() helper in AIAgent Replaces three identical provider=self.provider or None, model=self.model or None blocks in run_agent.py with a single source of truth. - Add tests for provider/model pass-through and fallback tests/tools/test_vision_thread_routing.py covers: • handle_function_call forwards provider/model • _handle_vision_analyze extracts them from **kw • vision_analyze_tool includes task='vision' in call_kwargs • Fallback via AUXILIARY_VISION_MODEL env var • _resolve_task_provider_model prefers explicit args over task config
Contributor
Author
|
Closing in favor of a cleaner, atomic PR. The new PR will contain only the vision thread-model routing fix. |
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.
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.
What does this PR do?
Related Issue
Fixes #
Type of Change
Changes Made
How to Test
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AFor New Skills
hermes --toolsets skills -q "Use the X skill to do Y"Screenshots / Logs