Skip to content
所有標籤

#unified-diff

1 篇文章

跟成熟 coding agent 學設計(10):編輯工具的取捨——unified diff、exact edit、hashline 與 whole-file

LLM 寫 unified diff 壞在簿記:hunk 行數算錯、上下文行幻覺。五家的答案分成兩派——把 diff 文法做簡單(Codex 拿掉行號)、或乾脆不用 diff(Claude Code/Pi/OpenCode 的 exact replace);OMP 更進一步用 hash 錨點綁住讀取狀態。rivumi 走最小干預:保留 guarded apply_patch,加一個零模糊匹配的 replace_text,qwen3:4b eval 就從穩定失敗變 5/5。