Repository navigation
Closed
Labels
migrate:type:auditAuditAuditmigrate:type:featureFeature or enhancementFeature or enhancementmigrate:type:reviewCode or design review taskCode or design review tasktype:audittype:featuretype:review
Description
Problem
Reviewer posts a new comment on every sync. This accumulates clutter in long review threads and creates notification spam.
Acceptance Criteria
- Checks for existing reviewer comment before posting
- Updates existing comment instead of creating new one
- Marks comment with unique identifier for later identification
- Preserves edit history (viewers can see what changed)
- Tests verify both create and update paths
Implementation Plan
1. Add Marker to Comment
<!-- reviewer-agent-summary -->2. Search for Existing Comment
async function findExistingReviewerComment(octokit, owner, repo, prNumber) {
const { data: comments } = await octokit.rest.issues.listComments({
owner,
repo,
issue_number: prNumber,
});
return comments.find(c => c.body.includes('<!-- reviewer-agent-summary -->'));
}3. Update or Create
const existingComment = await findExistingReviewerComment(octokit, owner, repo, pr.number);
const summary = buildSummaryMarkdown() + '\\n<!-- reviewer-agent-summary -->';
if (existingComment) {
await octokit.rest.issues.updateComment({
owner,
repo,
comment_id: existingComment.id,
body: summary
});
core.info('Updated existing review comment');
} else {
await octokit.rest.issues.createComment({
owner,
repo,
issue_number: pr.number,
body: summary
});
core.info('Created new review comment');
}4. Add Tests
- Test create on first run (no existing comment)
- Test update on second run (existing comment found and updated)
- Test comment ID is preserved
- Test marker is present in both cases
Test Cases
test('creates comment on first run', async () => {
const octokit = mockOctokit({
listComments: jest.fn().mockResolvedValue({ data: [] })
});
await run(context, { octokit });
expect(octokit.rest.issues.createComment).toHaveBeenCalled();
expect(octokit.rest.issues.updateComment).not.toHaveBeenCalled();
});
test('updates comment on second run', async () => {
const existingComment = {
id: 123,
body: '<!-- reviewer-agent-summary -->...'
};
const octokit = mockOctokit({
listComments: jest.fn().mockResolvedValue({
data: [existingComment]
})
});
await run(context, { octokit });
expect(octokit.rest.issues.updateComment).toHaveBeenCalledWith(
expect.objectContaining({ comment_id: 123 })
);
expect(octokit.rest.issues.createComment).not.toHaveBeenCalled();
});Effort Estimate
Small (1-2 hours)
Priority
🟡 MEDIUM - Reduces clutter and spam
Dependencies
- Requires: Phase 1 completed ([[PHASE 1] Fix Module System Inconsistency (CommonJS vs ES6) #599-602])
Related Issues
- Reference: ai/improvement-plan-planner-reviewer.md (Issue 2.5)
References
scripts/agents/reviewer.agent.js(lines 84-89)- GitHub Issues API: https://docs.github.com/en/rest/issues/comments
Metadata
Metadata
Assignees
Labels
migrate:type:auditAuditAuditmigrate:type:featureFeature or enhancementFeature or enhancementmigrate:type:reviewCode or design review taskCode or design review tasktype:audittype:featuretype:review
Type
Fields
Priority
None yet
Activity
linear-code commentedon May 31, 2026
LS-797
LS-2874
Phase 2: Feature Enhancements - Planner & Reviewer Agents
ashleyshaw commentedon May 31, 2026
✅ Completed - Merged in PR #641 (Phase 3 Polish: Complete Agent Implementation and Polish)
Comment deduplication has been implemented with:
octokit.paginate()Generated by Claude Code
Wave 5 Issue #670 Phase 3: Standardize plugin and .github subdirector…