fix(github): search up to 10 comment pages for the marker before posting a duplicate (#7232)#7278
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7278 +/- ##
=======================================
Coverage 93.81% 93.81%
=======================================
Files 704 704
Lines 69458 69458
Branches 18896 18896
=======================================
Hits 65163 65163
Misses 3302 3302
Partials 993 993
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-19 12:15:42 UTC
Review summary Nits — 4 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Summary
createOrUpdateIssueCommentWithMarker— the single chokepoint every LoopOver PR-panel / agent-command commentgoes through — searches an issue/PR's existing comments for LoopOver's own marker comment so it can
PATCHitinstead of posting a duplicate. That search was capped at
COMMENT_SEARCH_PAGE_LIMIT = 3(the first 300comments). On a PR/issue that accrued more than 300 comments before LoopOver's own, the marker fell outside the
search window, so every re-gate cycle POSTed a brand-new panel comment instead of updating the existing one.
This raises the cap to 10 pages (up to 1,000 comments), matching
src/github's other pagination bounds(
app.ts'sMAX_WORKFLOW_RUN_LIST_PAGES,pr-actions.ts'sREVIEW_PAGE_LIMIT). The existingif (batch.length < 100) break;early-exit is unchanged, so a short comment list still costs a single request;per_page: 100and the bot/marker filtering are untouched. Common-case behavior (< 300 comments) is identical.Closes #7232
Scope
site//CNAME/lovable; no new dependency.Closes #7232).Validation
git diff --checknpm run typecheck(root — clean)npm run test:coverage— 100% of the changed lines covered. New regression: a marker comment on page 4(beyond the old 300-comment cap) is now found and PATCHed rather than duplicated; the existing bound-enforcement
test is updated to assert the search still stops (now at 10 pages, not unbounded).
If any required check was skipped, explain why:
src/github/comments.ts(a non-guarded path) + its test; CI runs the full suite.Safety