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.
ApplyPatchTool
Section titled “ApplyPatchTool”from cayu.tools import ApplyPatchToolApply one fully preflighted, bounded multi-file patch.
Bases: Tool.
Fields and attributes
Section titled “Fields and attributes”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) |
init (method)
Section titled “init (method)”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) -> Nonename (property)
Section titled “name (property)”ApplyPatchTool.name() -> strexecution_profile_identity (property)
Section titled “execution_profile_identity (property)”ApplyPatchTool.execution_profile_identity() -> ExecutionProfileBehaviorIdentity | NoneReturn the stable behavior declaration frozen with this tool’s spec.
retain_arguments_for_model (property)
Section titled “retain_arguments_for_model (property)”ApplyPatchTool.retain_arguments_for_model() -> boolRetain 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.
description (property)
Section titled “description (property)”ApplyPatchTool.description() -> strschema (property)
Section titled “schema (property)”ApplyPatchTool.schema() -> dict[str, Any]run (method)
Section titled “run (method)”async ApplyPatchTool.run(ctx: ToolContext, args: dict[str, Any]) -> ToolResultreconcile_durable_tool_call (method)
Section titled “reconcile_durable_tool_call (method)”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 | NoneReconstruct durable patch boundaries without dispatching mutations.