Context
Split out of #1299 during its own local-strict-review pass, which flagged this as a related but out-of-scope gap in the same fix.
The defect
reply_to_thread() prints each unresolved thread via describe(), which collapses the thread body's whitespace to single spaces (" ".join(body.split())) and truncates it to 120 characters before printing it as the unresolved: line a NO_MATCH refusal shows.
matching_threads() itself compares --match against the thread's raw, uncollapsed, untruncated body.
So a --match string copied verbatim from one of those printed unresolved: lines can still return NO_MATCH, in two ways:
- The pattern spans a point in the body that carried a line break, tab, or run of multiple spaces in the original, now printed back as a single space; the raw body still carries the original whitespace, so the collapsed substring is not literally present in it.
- The pattern is copied at or past the 120-character cutoff, past which the printed line carries nothing to copy from at all.
This is the same shape of failure #1299 fixed: a --match string that a caller copied straight from what this script itself printed still fails to select the thread it was copied from.
Suggested fix
Worth considering: fold whitespace the same way on both sides before the substring compare (matching describe()'s own collapse), so a pattern copied from the printed line matches the same way the original would have. The 120-character truncation is a display concern rather than a matching one and may not need a corresponding change beyond documenting the limit.
Context
Split out of #1299 during its own local-strict-review pass, which flagged this as a related but out-of-scope gap in the same fix.
The defect
reply_to_thread()prints each unresolved thread viadescribe(), which collapses the thread body's whitespace to single spaces (" ".join(body.split())) and truncates it to 120 characters before printing it as theunresolved:line aNO_MATCHrefusal shows.matching_threads()itself compares--matchagainst the thread's raw, uncollapsed, untruncated body.So a
--matchstring copied verbatim from one of those printedunresolved:lines can still returnNO_MATCH, in two ways:This is the same shape of failure #1299 fixed: a
--matchstring that a caller copied straight from what this script itself printed still fails to select the thread it was copied from.Suggested fix
Worth considering: fold whitespace the same way on both sides before the substring compare (matching
describe()'s own collapse), so a pattern copied from the printed line matches the same way the original would have. The 120-character truncation is a display concern rather than a matching one and may not need a corresponding change beyond documenting the limit.