[Regression] gpt-oss no longer has access to apply_patch
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: https://github.com/openai/codex/commit/a1abd53b6aa57f793e3552d66219e171a5f0f8c5
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.
6 Comments
The regression is still present in 0.104.0.
models.json now has slugs for gpt-oss-20b / gpt-oss-120b -- can we just change apply_patch_tool_type -> 'function' there?
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.Well, the function-style tool is now gone entirely, and gpt-oss defaults to not having a patch tool at all now: https://github.com/openai/codex/pull/21651
Which is quite a sad demonstration of support for gpt-oss.
Confirm with Codex CLI 0.142.3
+!