Skip to content

Conversation

andrewtlw
Copy link

@andrewtlw andrewtlw commented Aug 28, 2025

Model providers like Groq, Openrouter, AWS Bedrock, VertexAI and others typically prefix the name of gpt-oss models with openai, e.g. openai/gpt-oss-120b.

This PR is to match the model name slug using contains instead of starts_with to ensure that the apply_patch tool is included in the tools for models names like openai/gpt-oss-120b

Without this, the gpt-oss models will often try to call the apply_patch tool directly instead of via the shell command, leading to validation errors.

I have run all the local checks.

Note: The gpt-oss models from non-Ollama providers are typically run via a profile with a different base_url (instead of with the --oss flag)

Copy link

github-actions bot commented Aug 28, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@andrewtlw
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

…ere gpt-oss model names from different providers have a prefix like openai/gpt-oss/120b
@andrewtlw andrewtlw force-pushed the oss-model-family-slug-matching branch from fac5f52 to 119ed46 Compare August 28, 2025 06:31
github-actions bot added a commit that referenced this pull request Aug 28, 2025
@andrewtlw
Copy link
Author

hey @dylan-hurd-oai @bolinfest - would love to get any feedback on this, thanks!

@dylan-hurd-oai dylan-hurd-oai self-requested a review September 3, 2025 16:00
Copy link
Collaborator

@dylan-hurd-oai dylan-hurd-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1-comment to discuss, but appreciate the simple suggestion!

@@ -96,7 +96,7 @@ pub fn find_family_for_model(slug: &str) -> Option<ModelFamily> {
slug, "gpt-4.1",
needs_special_apply_patch_instructions: true,
)
} else if slug.starts_with("gpt-oss") {
} else if slug.contains("gpt-oss") {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable! My only concern is that (like most of our apply_patch setups), the apply_patch_tool is a relatively specific approach. I wonder if we instead want to do something like slug.starts_with("gpt-oss") || slug.starts_with("openai/gpt-oss"). @andrewtlw how consistent across providers is the prefix pattern you described? Do we need the flexibility of contains here?

Copy link
Author

@andrewtlw andrewtlw Sep 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dylan-hurd-oai. I did think the same initially. The prefix pattern openai/gpt-oss-* is the most common (vertex ai, open router, hugging face inference, groq, etc), but there's also @cf/openai/gpt-oss-* for Cloudflare Workers AI and openai.gpt-oss-* on AWS bedrock.

I did some testing and CF and Bedrock actually don't support tool calling on the gpt-oss models, so likely aren't going to be used as providers for codex-cli anytime soon.

Will make the change to the suggested slug.starts_with("gpt-oss") || slug.starts_with("openai/gpt-oss")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants