[codex] Delete function-style apply_patch#21651
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ee59b7b87c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| #[serde(default)] | ||
| pub supports_apply_patch_tool: bool, |
There was a problem hiding this comment.
Preserve legacy apply_patch metadata
When model metadata still comes from an older /models response, cached catalog, or user-provided catalog using "apply_patch_tool_type": "freeform", this new field is missing and defaults to false; ToolsConfig::new then does not register apply_patch unless the feature flag happens to be enabled. Because ModelInfo is serialized across service/client boundaries, please keep a migration path (for example, deserialize the old field as an alias/custom fallback) so existing metadata does not silently lose the apply_patch tool during rollout/version skew.
Useful? React with 👍 / 👎.
This reverts commit ee59b7b.
…n-apply-patch # Conflicts: # codex-rs/tools/src/tool_config.rs
Why
apply_patchis now a freeform/custom tool. Keeping the old JSON/function-style registration and parsing path left another way for models and tests to invokeapply_patch, which made the tool surface harder to reason about.What changed
ApplyPatchToolType::Functionvariant, JSONapply_patchspec, and handler support for function payloads.apply_patch_tool_type = freeformas the supported model metadata path, including Bedrock catalog metadata.apply_patchtests and SSE fixtures to custom/freeform tool calls.Verification
cargo test -p codex-tools -p codex-protocol -p codex-model-providercargo test -p codex-core tools::handlers::apply_patch --libcargo test -p codex-core --test all apply_patch_tool_executes_and_emits_patch_eventscargo test -p codex-core --test all apply_patch_reports_parse_diagnosticscargo test -p codex-exec test_apply_patch_tooljust fix -p codex-corejust fix -p codex-tools -p codex-protocol -p codex-model-provider -p codex-exec