#3150 reworded write_file's description, overwrite parameter, and guard error to prefer append_file/edit_file. But those tools register via their own enable flags and the per-agent allowlist, so a config exposing only write_file was steered toward tools it does not have — a dead end in the most restrictive setups. WriteFileTool now tracks which non-destructive alternatives are available and names only the ones present; when none are, the guard still blocks the overwrite without pointing anywhere. The agent wiring registers the editors before write_file and resolves availability via registry.HasRegistered, which reflects both the enable flag and the allowlist. Tests: conditional copy at the tool level (none/one/both) and agent wiring across the enable-flag and allowlist dimensions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| edit.go | ||
| edit_test.go | ||
| filesystem.go | ||
| filesystem_test.go | ||
| filesystem_windows_path_test.go | ||
| load_image.go | ||
| load_image_test.go | ||
| send_file.go | ||
| send_file_test.go | ||
| shared.go | ||