Skip to content

[codex] Delete function-style apply_patch#21651

Merged
pakrym-oai merged 11 commits intomainfrom
pakrym/delete-function-apply-patch
May 8, 2026
Merged

[codex] Delete function-style apply_patch#21651
pakrym-oai merged 11 commits intomainfrom
pakrym/delete-function-apply-patch

Conversation

@pakrym-oai
Copy link
Copy Markdown
Collaborator

Why

apply_patch is now a freeform/custom tool. Keeping the old JSON/function-style registration and parsing path left another way for models and tests to invoke apply_patch, which made the tool surface harder to reason about.

What changed

  • Removed the ApplyPatchToolType::Function variant, JSON apply_patch spec, and handler support for function payloads.
  • Kept apply_patch_tool_type = freeform as the supported model metadata path, including Bedrock catalog metadata.
  • Migrated apply_patch tests and SSE fixtures to custom/freeform tool calls.

Verification

  • cargo test -p codex-tools -p codex-protocol -p codex-model-provider
  • cargo test -p codex-core tools::handlers::apply_patch --lib
  • cargo test -p codex-core --test all apply_patch_tool_executes_and_emits_patch_events
  • cargo test -p codex-core --test all apply_patch_reports_parse_diagnostics
  • cargo test -p codex-exec test_apply_patch_tool
  • just fix -p codex-core
  • just fix -p codex-tools -p codex-protocol -p codex-model-provider -p codex-exec

@pakrym-oai pakrym-oai marked this pull request as ready for review May 8, 2026 07:01
@pakrym-oai pakrym-oai requested a review from a team as a code owner May 8, 2026 07:01
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread codex-rs/protocol/src/openai_models.rs Outdated
Comment on lines +282 to +283
#[serde(default)]
pub supports_apply_patch_tool: bool,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@pakrym-oai pakrym-oai merged commit e783341 into main May 8, 2026
26 checks passed
@pakrym-oai pakrym-oai deleted the pakrym/delete-function-apply-patch branch May 8, 2026 20:01
@github-actions github-actions Bot locked and limited conversation to collaborators May 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants