Skip to content

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

@Mushoz

Description

@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: 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?

  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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentIssues related to the core agent loopbugSomething isn't workingcustom-modelIssues related to custom model providers (including local models)tool-callsIssues related to tool calling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions