Repository navigation
Description
What version of Codex CLI is running?
0.101.0
What subscription do you have?
Business
Which model were you using?
gpt-oss-120b
What platform is your computer?
Archlinux
What terminal emulator and version are you using (if applicable)?
Gnome Console
What issue are you seeing?
In the following commit: a1abd53
The code to add the apply_patch tool when using gpt-oss was removed:
} else if slug.starts_with("gpt-oss") || slug.starts_with("openai/gpt-oss") {
model_info!(
slug,
apply_patch_tool_type: Some(ApplyPatchToolType::Function),
context_window: Some(96_000),
)
This leaves the gpt-oss models without any tool to edit, making them close to useless.
What steps can reproduce the bug?
- Start Codex with gpt-oss
- Ask the model to edit a random file
What is the expected behavior?
- The model will use apply_patch to apply edits
Actual outcome:
- The model will try to use workarounds, such as editing with
sed
Additional information
Either the behavior before this commit must be reintroduced, but a cleaner fix would probably be to make this configurable, as hardcoded values for gpt-oss models is a lot less maintainable. Right now, we can actually already do the following in the configuration .toml:
[features]
apply_patch_freeform = true
Which will give the model access to the freeform version of apply_patch. Since gpt-oss expects the json version, this does not work (well). Ideally a new configuration option is introduced to give a model access to the json/function version of apply_patch.
Note: I am more than happy to write a PR to introduce such a configuration option. Kindly let me know if such a approach would be accepted, since I'd hate for me to write a pull request only for it to be rejected. If a different approach is preferred, kindly let me know and I will try to implement such an alternatively approach in a PR.
Activity
vt-alt commentedon Feb 21, 2026
The regression is still present in 0.104.0.
vsrinivas commentedon Feb 27, 2026
models.json now has slugs for gpt-oss-20b / gpt-oss-120b -- can we just change apply_patch_tool_type -> 'function' there?
Mushoz commentedon Feb 27, 2026
While that would solve the issue at hand for the gpt-oss models, I'd rather see a more generic solution which allows us to define the apply_patch_tool_type in each of our profiles. That way, we can also use different, non-gpt-oss models. Furthermore, slug parsing can be brittle. I am not sure exactly how the slug matching is done, but if it's checking if the model string starts with
gpt-ossthat will not match models/aliases such ashigh-gpt-oss-120bormedium-gpt-oss-120bwhere the same model is loaded with different reasoning effort settings.coder543 commentedon May 27, 2026
Well, the function-style tool is now gone entirely, and gpt-oss defaults to not having a patch tool at all now: #21651
Which is quite a sad demonstration of support for gpt-oss.
66Ton99 commentedon Jul 4, 2026
Confirm with Codex CLI 0.142.3
iqdoctor commentedon Jul 9, 2026
+!
TheMiNuS commentedon Aug 30, 2026
if it can help some of you i did a patch for my LocalAI/Qwen that was suffering of the same problem. You can find it here : https://github.com/TheMiNuS/codex-localai-qwen
It exposes apply_patch as a JSON Function tool when the Qwen model entry select it.