[Regression] gpt-oss no longer has access to apply_patch

Open 💬 6 comments Opened Feb 16, 2026 by Mushoz

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?

  1. Start Codex with gpt-oss
  2. Ask the model to edit a random file

What is the expected behavior?

  1. The model will use apply_patch to apply edits

Actual outcome:

  1. 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.

View original on GitHub ↗

6 Comments

vt-alt · 4 months ago

The regression is still present in 0.104.0.

vsrinivas · 4 months ago

models.json now has slugs for gpt-oss-20b / gpt-oss-120b -- can we just change apply_patch_tool_type -> 'function' there?

Mushoz · 4 months ago
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-oss that will not match models/aliases such as high-gpt-oss-120b or medium-gpt-oss-120b where the same model is loaded with different reasoning effort settings.

coder543 · 1 month ago

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.

66Ton99 · 16 days ago

Confirm with Codex CLI 0.142.3

iqdoctor · 11 days ago

+!