Skip to main content

Module apply_patch

Module apply_patch 

Source
Expand description

Patch tool facade that exposes Codex-compatible patch parsing and application.

Actual patch parsing logic lives in tools::editing::patch so future edit features can reuse the same primitives without depending on this facade.

Re-exports§

pub use crate::tools::editing::Patch;
pub use crate::tools::editing::PatchError;
pub use crate::tools::editing::PatchHunk;
pub use crate::tools::editing::PatchLine;
pub use crate::tools::editing::PatchOperation;

Structs§

ApplyPatchInput
Input structure for the apply_patch tool
DecodedApplyPatchInput

Constants§

APPLY_PATCH_ALIAS_DESCRIPTION
MAX_DECODED_PATCH_BYTES
Maximum allowed decoded patch size — same as UNIFIED_FILE_MAX_PAYLOAD_BYTES but exposed with a more specific name to clarify that it is enforced at decode time, not preflight time.
SEMANTIC_ANCHOR_GUIDANCE
UNIFIED_FILE_MAX_PAYLOAD_BYTES
Hard upper bound for any single apply_patch payload (and unified_file edit/patch actions) after base64 decoding. The preflight cap mirrors this same value; both share the same env-var override.
UNIFIED_FILE_MAX_PAYLOAD_BYTES_ENV
Env var name that overrides both the preflight cap and the post-decode cap.

Functions§

decode_apply_patch_input
effective_max_payload_bytes
Resolve the effective cap, honoring the env-var override. A 1 KiB safety floor is enforced so a sub-floor override can never silently disable the post-decode cap; values below the floor fall back to the default. The same floor is applied by the preflight resolver in execution_kernel so both stages agree on the effective cap.
parameter_schema
patch_source_from_args
with_semantic_anchor_guidance