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
Null comment coordinates become a line-zero selection #51319
Comment metadata parsing converts selection fields with Number(...). JavaScript converts null to 0, so malformed metadata containing null coordinates passes the finite-number check and becomes a real {0, 0, 0, 0} selection. This can restore a review comment at line zero instead of treating its invalid selection as absent. Selection coordinates should be accepted only when all four fields are finite numbers.
Plugins
None
OpenCode version
1.18.30
Steps to reproduce
Read comment metadata containing a valid path and comment.
Set startLine, startChar, endLine, and endChar in its selection to null.
Observe the parsed comment metadata.
Expected: the comment is retained with no selection.
Actual: the parser returns a line-zero selection with all four coordinates set to 0.
Screenshot and/or share link
Not applicable; the metadata parser call above reproduces the issue directly.
I'd like to take this one. The parser in packages/app/src/utils/comment-note.ts coerces selection fields with Number(...), so null becomes 0 and passes the finite check, restoring a real {0,0,0,0} selection. I'll require all four coordinates to be finite numbers, keep the comment without a selection otherwise, and add a regression test. Please assign if this scope looks right.
Activity
Serenity-2026 commentedon Sep 27, 2026
I'd like to take this one. The parser in
packages/app/src/utils/comment-note.tscoerces selection fields withNumber(...), sonullbecomes0and passes the finite check, restoring a real{0,0,0,0}selection. I'll require all four coordinates to be finite numbers, keep the comment without a selection otherwise, and add a regression test. Please assign if this scope looks right.thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊