Exclude current issue from triage related-issue search#177
Conversation
Filter out the issue being triaged from its own search results to prevent Claude from flagging it as a duplicate of itself. Also parse the gh output as JSON before returning, catching invalid JSON gracefully instead of passing it through raw. Fixes #164
Review by KaiThis is a clean, focused fix. One minor finding and a couple of suggestions: SUGGESTION — If This isn't a regression (the pre-existing code had no protection here either), but since you're already adding JSON parsing, a issues = json.loads(raw)
if not isinstance(issues, list):
return "[]"SUGGESTION —
No bugs, no security issues. The |
Review by KaiBoth suggestions from the prior review were addressed: the Clean. The implementation is correct and the three new tests cover the meaningful cases. One minor observation that doesn't warrant blocking: SUGGESTION — If Everything else looks good: backward compatibility is preserved, JSON re-serialization is safe, the caller correctly passes |
Summary
Exclude the current issue from its own related-issue search results in the triage pipeline. Previously,
search_related_issues()could return the issue being triaged as one of its own related issues, causing Claude to flag it as a duplicate of itself.Changes
issue_numberparametersearch_related_issues()(default 0 for backward compat)ghoutput now parsed and re-serialized; invalid JSON returns"[]"triage_issue()passesmetadata.numberTest plan
test_excludes_current_issue- issue Remove redundant foreign workspace memory injection #42 removed, others preservedtest_empty_after_exclusion- sole result is current issue, returns emptytest_invalid_json_returns_empty- garbage fromghreturns"[]"issue_numberuses default 0, no filtering)make checkcleanFixes #164