gemini_patch
Have Gemini propose a code change as a unified diff, validated with git apply --check against your working tree and never applied, so you can review and apply it yourself.
Instructions
Have Gemini propose a code change as a unified diff. zwilling checks the paths it touches (same rules as attachments) and dry-runs it with git apply --check against the working tree, but never applies it: review it and apply it yourself. Attach every file the change touches. If it doesn't apply, call again with follow_up and the error.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"instructions": "<instructions>"
},
"name": "gemini_patch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| diff | No | Attach a git diff: "staged" (index vs HEAD), "working" (unstaged), "HEAD" (all uncommitted changes), a ref, or a range like "main...HEAD". Counts against the size limit. | |
| files | No | Paths relative to the project root (max 20 files, 500 KB total). Also accepts line ranges (src/a.ts:40-120), directories (src/) and globs (src/**/*.ts); globs and directories respect .gitignore. Contents are inlined into the prompt. | |
| model | No | Model ID as listed by `agy models`; the suffix is the reasoning effort, e.g. gemini-3.8-flash-low | -medium | -high. Omit to use the configured default (.zwilling.json, else agy's). Higher effort is slower. | |
| follow_up | No | Log entry id of an earlier answer (e.g. g-20261113-a1b2c3, shown after every answer). Its question and answer are sent along as context. One level only: the earlier entry's own history is not included. | |
| timeout_s | No | Timeout for this call in seconds (default 120). | |
| instructions | Yes | The change to make. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Why the patch was not found, was refused, or does not apply. | |
| files | Yes | Root-relative paths the patch touches. | |
| patch | Yes | The proposed unified diff, or null if the answer contained none. | |
| applies | Yes | True if the patch passed the path checks and `git apply --check` against the current working tree. |