Add dynamic OpenAI model fetching with vision-only filtering #173
+155
−16
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.
This fixes task execution failures when using non-vision models like O3-mini with computer-use agents that send screenshots.
This pull request enhances how available OpenAI models are managed and surfaced in the Bytebot agent. The most significant changes include dynamically fetching and caching OpenAI models that support vision (image inputs), improving fallback logic, and updating the models list to prioritize relevant options. Additionally, there are minor UI improvements to the select dropdown component.
Dynamic OpenAI Model Management:
getAvailableModelsinOpenAIServiceto fetch available models from the OpenAI API, filter for those supporting vision, cache them for one hour, and provide a fallback to a hardcoded list if needed. This ensures the agent always offers up-to-date and relevant model options.OPENAI_MODELSlist to include only models that support vision (image input), with revised names, titles, and context windows.Integration with Task Controller:
TasksControllerto fetch OpenAI models dynamically using the newgetAvailableModelsmethod, with a fallback to the hardcoded list if fetching fails. Models from other providers are still included based on API key presence.TasksModuleto importOpenAIModuleso thatOpenAIServicecan be injected intoTasksController.UI Improvement:
SelectContentby limiting its maximum height and enabling vertical scrolling, enhancing usability when many models are available.