Commit graph

8 commits

Author SHA1 Message Date
Yue_chen
a680d8fcfa fix(tools): gate write_file overwrite guidance on available tools
#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>
2026-07-07 20:40:27 +08:00
Yue_chen
8f891d5dd0 fix(tools): stop write_file from coaching destructive overwrite (#3150)
The overwrite guard error ("Set overwrite=true to replace") steered the
model to clobber files like MEMORY.md. Reword write_file's description,
overwrite param, and guard error to prefer append_file/edit_file.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-05 14:13:31 +08:00
danmobot
acc2c5c6aa test(fs): cover root path separator normalization 2026-06-23 20:57:42 +01:00
程智超0668000959
df753aaebf fix(filesystem): explicitly ignore Close() error on directory file descriptor 2026-06-14 23:45:48 +08:00
Mauro
f091c04ca9
Merge pull request #3066 from chengzhichao-xydt/codex/tmpfile-close-errors
fix: explicitly ignore Close() errors on temp file write/sync failure paths
2026-06-13 18:18:47 +02:00
cs8425
355e83e07f fix os.Root api on windows issue 2026-06-10 12:31:35 +08:00
程智超0668000959
6b004f6a5f fix: explicitly ignore Close() errors on temp file write/sync failure paths 2026-06-09 09:52:48 +08:00
lc6464
4c133dc2d9
refactor(tools): reorganize tool packages and facades 2026-04-17 13:44:31 +08:00
Renamed from pkg/tools/filesystem.go (Browse further)