Skip to content

cayu.tools.patches

Public Cayu API. Definitions are grouped by their public source module, and definitions from private implementation modules appear on their package’s page; adding a symbol does not move existing links. The import shown at each entry is a supported public namespace. Read the Python API overview and install the required extra.

from cayu.tools import ApplyPatchTool

Apply one fully preflighted, bounded multi-file patch.

Bases: Tool.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
spec class attribute _apply_patch_tool_spec(max_operations=MAX_PATCH_OPERATIONS)
ApplyPatchTool.__init__(*, max_operations: int=MAX_PATCH_OPERATIONS, max_input_bytes: int=MAX_PATCH_INPUT_BYTES, max_file_bytes: int=MAX_PATCH_FILE_BYTES, max_source_bytes: int=MAX_PATCH_SOURCE_BYTES, max_output_bytes: int=MAX_PATCH_OUTPUT_BYTES, max_retained_diff_bytes: int=MAX_PATCH_RETAINED_DIFF_BYTES, max_diff_preview_bytes: int=DEFAULT_PATCH_DIFF_PREVIEW_BYTES, max_file_diff_preview_bytes: int=DEFAULT_PATCH_FILE_DIFF_PREVIEW_BYTES, max_artifact_bytes: int=MAX_PATCH_ARTIFACT_BYTES, protected_entry_names: Iterable[str]=DEFAULT_PATCH_PROTECTED_ENTRY_NAMES, spec: ToolSpec | None=None) -> None
ApplyPatchTool.name() -> str
ApplyPatchTool.execution_profile_identity() -> ExecutionProfileBehaviorIdentity | None

Return the stable behavior declaration frozen with this tool’s spec.

ApplyPatchTool.retain_arguments_for_model() -> bool

Retain bounded redacted original inputs privately for the same profile.

Independent of audit publication; oversized and compacted-away inputs may be omitted. This does not grant knowledge read or activation rights.

ApplyPatchTool.description() -> str
ApplyPatchTool.schema() -> dict[str, Any]
async ApplyPatchTool.run(ctx: ToolContext, args: dict[str, Any]) -> ToolResult
async ApplyPatchTool.reconcile_durable_tool_call(*, parent_session_id: str, parent_run_epoch: int, execution_profile_fingerprint: str | None, environment_name: str | None, environment_allocation_fingerprint: str | None, model_step_id: str, model_attempt_id: str, tool_round_id: str, tool_call_id: str, idempotency_key: str, arguments: dict[str, Any], started: bool, load_operation: Callable[[str], Awaitable[dict[str, Any] | None]], recovery_authority: DurableToolRecoveryAuthority | None=None) -> DurableToolRecoveryEvidence | None

Reconstruct durable patch boundaries without dispatching mutations.

Release source · Runtime guarantees · Capability guides