fix(openai): gate native tools by model support - #613
Open
solvemproblr wants to merge 2 commits into
Open
Conversation
solvemproblr
marked this pull request as ready for review
August 23, 2026 15:00
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9a101a0. Configure here.
solvemproblr
marked this pull request as draft
August 23, 2026 15:42
solvemproblr
marked this pull request as ready for review
August 23, 2026 15:43
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.

Issue
The OpenAI Responses agent registered native
shellandcomputertools whenever an environment exposed the corresponding SSH or RFB capability, regardless of whether the selected model supports those provider-native tool types. In production, a rollout usinggpt-4o-miniwith a shell-capable environment failed before inference withTool 'shell' is not supported with gpt-4o-mini.The SDK already has the right ownership boundary:
AgentToolSpec.supported_models,default_spec(model), and the generic tool assembly path that skips a tool whendefault_specreturnsNone. The model metadata and conditional return had been removed from both OpenAI native tools.Solution
Nonefor unsupported models so the shared SDK tool builder omits the incompatible provider parameter before request construction.gpt-4o-minireceives neither native tool while supported base, variant, and versioned GPT-5 model IDs retain them.Impact
Rollouts no longer fail merely because an environment exposes a capability that the selected OpenAI model cannot consume. The rollout continues without that capability and emits an operator-visible warning explaining the omission. Capability/model compatibility remains SDK-owned and applies to every caller of the OpenAI agent; no rollout-specific guard or model remapping is introduced.
Validation
uv run --extra dev --extra modal pytest -q— 1,122 passed, 17 deselecteduv run --extra dev pytest -q hud/agents/tests— 159 passeduv run --extra dev ruff format . --checkuv run --extra dev ruff check .uv run --extra dev ty check hud/agents/tool_agent.py hud/agents/openai/tools/coding.py hud/agents/openai/tools/computer.py hud/agents/tests/test_provider_native_tools.pyNote
Medium Risk
Changes which native tools are sent to OpenAI based on model ID patterns. Wrong allowlists could omit tools on supported models or still send them on unsupported ones.
Overview
Stops OpenAI native
shellandcomputertools from being registered when the selected model cannot use them (e.g.gpt-4o-miniwith a shell-capable env).default_specnow returnsNoneunless the model matches GPT-5.4/5.5/5.6 (including variants). Shared_build_toolsonly warns when a matching capability is present and otherwise continues the rollout without those tools.Reviewed by Cursor Bugbot for commit 785316d. Bugbot is set up for automated code reviews on this repo. Configure here.