Edit 工具的 provider-visible tool_result 是模型判断编辑是否生效、是否需要重读文件的依据。
本文约束 Edit 成功与失败时的模型可见文本、old_string 的转义匹配,以及 read-before-edit
的读取状态判定。
(file state is current in your context — no need to Read it back)。<tool_use_error>...</tool_use_error>,但 UI/日志使用的原始错误消息仍保持裸文本。old_string 中的 \uXXXX escape 应能匹配文件中的真实字符,例如
<tag> 匹配 <tag>。<tool_use_error> 包装污染。old_string 匹配。apps/zcode-cli/packages/core/tests/edit-tool-contract.test.tspnpm typecheckpnpm lint