You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Edit tools don't normalize Unicode (NFC vs NFD) causing edit failures on macOS #31786
Both V1 and V2 edit tools do not normalize Unicode before comparing file content with oldString. On macOS where files are often stored in NFD (decomposed) form, while AI-generated text is NFC (precomposed), Unicode canonically-equivalent characters like é (U+00E9) vs e + combining accent (U+0065 U+0301) will not match, causing edit failures.
Affected Files
packages/core/src/tool/edit.ts:164 - countOccurrences uses indexOf without normalization
packages/core/src/tool/edit.ts:187 - replace uses string comparison without normalization
packages/opencode/src/tool/edit.ts:132 - replace() function uses indexOf without normalization
Inconsistency
packages/opencode/src/patch/index.ts:486 already has NFC normalization for apply_patch:
Activity
github-actions commentedon Jun 10, 2026
This issue might be related to an existing open issue. Please check:
apply_patch/seekSequencewhile this one targets theedittool, but they share the same root cause and proposed fix pattern.You may want to coordinate with the reporter of #31651 or consider whether a single PR could address both tools at once.