fetch-review-threads emits `"threads": null` for PRs with zero threads, triggering a false "invalid or truncated" warning
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start in internal/forge/github/github.go where the review-thread fetch initializes its result as forge.ReviewThreadPage{} and appends threads; the nil slice is what encodes as null in internal/cli/fetchreviewthreads.go. Initialize Threads as an empty slice and add a unit test in internal/cli asserting a zero-thread PR emits "threads": []. Done when that test passes and the empty-result output is a JSON array.
Written by the indexing model from the issue text.
Description
What happened
Review 2 on PR #45 (run 42694315057, pre-script at about 20:36 UTC) logged "Review thread fetch was invalid or truncated — human dismissals cannot be verified". At that point the PR had zero review threads; the first was created at 20:45:29.
Cause:
- In fullsend v0.54.0, the GitHub forge starts from
result := forge.ReviewThreadPage{}and only appends threads (github.go#L4056, #L4131). - With no threads, the slice stays nil and
internal/cli/fetchreviewthreads.goencodes it as"threads": null. - The agents-side consumer
forge_get_human_dismissalsrequires.threadsto be an array, so it reports invalid or truncated output (review-ops.lib.sh#L79-L84).
What could go better
I'm confident about the cause, from reading the code paths at the pinned versions. It is not proven in a debugger.
The impact today is mostly noise: with zero threads there are no dismissals to apply. But the warning claims human dismissals "cannot be verified", which wrongly suggests a data-integrity problem. Every first re-review of a PR without inline threads will hit it. That misleads maintainers and retro analysis, and it masks the real truncation case the warning was written to catch.
Proposed change
In internal/forge/github/github.go, in the review-thread fetch, initialize the result with Threads: []forge.ReviewThread{} (or the equivalent field and type in internal/forge/forge.go), so an empty page encodes as "threads": []. Do the same in the GitLab implementation if it uses the same pattern.
Add a unit test in internal/cli for fetch-review-threads: a PR with zero threads must produce a JSON array, not null.
Optionally, also make the agents-side check in scripts/lib/review-ops.lib.sh accept null as empty (.threads // []) for backward compatibility with older CLI versions. That would be a separate small change in fullsend-ai/agents.
Validation criteria
- Unit test:
fetch-review-threadsoutput for a zero-thread PR contains"threads": []. - Live check: across the next 5 re-reviews of PRs with no inline review threads, the pre-review log no longer prints "Review thread fetch was invalid or truncated".
Related issues checked
Searched: review thread fetch truncated / invalid or truncated human dismissals (fullsend-ai/fullsend, fullsend-ai/agents, shairevivo/react-shopping-cart); reviewThreads pagination / fetch-review-threads null / ReviewThreadPage threads empty
Considered: fullsend-ai/agents#1515, #8174
agents#1515: test coverage for the reviewThreads pagination loop; does not cover nil-slice encoding of an empty result. #8174 (closed): normalizing thread position metadata across forges; unrelated to empty-result encoding.
Generated by retro agent from https://github.com/shairevivo/react-shopping-cart/pull/45
- Dominant language
- Go
- Stars
- 146
- Forks
- 112
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 358
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fullsend-ai/fullsend
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
fullsend-ai/fullsend#9404 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
fullsend-ai/fullsend#9371 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
fullsend-ai/fullsend#9278 ·
Maintainers usually reply within 1 day
-
question
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
fullsend-ai/fullsend#9251 · 4 comments ·
Maintainers usually reply within 1 day
-
blocked
Difficulty 1/5 Under an hour Newbie friendliness 88/100
fullsend-ai/fullsend#9249 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
All issues in fullsend-ai/fullsend
Similar issues
-
0.kind: bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Judgment-Pack/judgment-pack-runtime#390 ·
Maintainers usually reply within 1 day
-
triage/needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
cozystack/cozystack#5300 · 1 reaction ·
Maintainers usually reply within 2 days
-
bug go
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
teradata-labs/loom#665 ·
Maintainers usually reply within 1 day
-
Improve DB UIOpenenhancement ui/ux
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
jbigler/railswitch#222 ·
Maintainers usually reply within 1 day