Repository navigation
feat: Freeform apply_patch with simple shell output - #4718
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
|
|
||
| /// Force-enable the apply_patch tool even for models that do not opt into it by default. | ||
| #[arg(long = "custom-apply-patch", default_value_t = false)] | ||
| pub custom_apply_patch: bool, |
There was a problem hiding this comment.
we have an experimental_supported_tools config, can we reuse it?
There was a problem hiding this comment.
that's only in model_family, not exposed as a config option. I think we should keep this tied to apply_patch_tool_type in ModelFamily, since it's clearer. We do not want to make the Custom definition and the Freeform definition available at the same time.
|
let's add integration tests that exercise the flag and assert the resulting request body. https://github.com/openai/codex/pull/4706/files for examples |
jif-oai
left a comment
There was a problem hiding this comment.
Ok once the config flag is dropped to use the existing one (see Pavel's comment)
456dee9 to
96bbe5f
Compare
fb7f316 to
f4c7577
Compare
| serde_json::from_str::<Value>(output).is_err(), | ||
| "expected truncated shell output to be plain text", | ||
| ); | ||
| assert!( |
There was a problem hiding this comment.
non-blocking nit: I'd prefer a regex
| }) | ||
| .await?; | ||
|
|
||
| loop { |
There was a problem hiding this comment.
Copied the pattern from
codex/codex-rs/core/tests/suite/tools.rs
Lines 25 to 26 in f4c7577
| }) | ||
| } | ||
|
|
||
| fn is_shell_tool_name(name: &str) -> bool { |
There was a problem hiding this comment.
don't we have to rewrite apply patch?
| base_instructions: None, | ||
| include_plan_tool: Some(include_plan_tool), | ||
| include_apply_patch_tool: Some(true), | ||
| include_apply_patch_tool: None, |
There was a problem hiding this comment.
@pakrym-oai @jif-oai this should be off by default - tui has it off and we should only be enabling it for models that support the freeform tool. Many models do not support custom tool calls
Summary
This PR is an alternative approach to #4711, but instead of changing our storage, parses out shell calls in the client and reserializes them on the fly before we send them out as part of the request.
What this changes:
This change is delicate, but is not meant to be permanent. It is meant to be the first step in a migration:
Test Plan