apply_patch
Apply agent-generated unified diffs to files. Use check_only to verify the patch applies cleanly before writing changes.
Instructions
Apply an agent-generated unified diff to files under target_path.
Uses git apply, which refuses paths that escape the target directory.
Run with check_only=True first to verify the patch applies cleanly
before writing changes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target_path | Yes | Directory the patch paths are relative to. | |
| patch | Yes | The unified diff text to apply. | |
| check_only | No | If True, validate without modifying any files. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |