Repository navigation
Handle GitHub's 2500-comment issue limit in maintenance and no-op tracker - #79689
Conversation
The agentic maintenance no-repro job crashed on '[aw] No-Op Runs' (#71166) because GitHub rejects comments on issues with more than 2500 comments. Skip the close comment in that case and still close the issue. The no-op handler now closes the full tracking issue and posts to a fresh one. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ PR Specification Reviewer completed successfully! PR Specification ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
Found two correctness issues in rollover handling:
- The exhausted issue is closed before replacement creation/posting succeeds, so an API failure can lose the current no-op record.
- Concurrent runs can each rotate the same full issue and create duplicate open trackers.
Please make rollover lossless and converge concurrent rotations on one tracker.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.6K
Comment /review to run again
Comment MemoryPeek at saved memory (review-history)History |
Comment MemoryPeek at saved memory (spec-review-history)History |
…ement Post to the replacement tracker before closing the full one, and reuse an open replacement found via issues.listForRepo before creating another. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
There was a problem hiding this comment.
🔵 Needs a closer look
Concurrent workflows can each create a replacement for the same full tracker, splitting run history across multiple open trackers because rollover is not serialized across workflows.
No open issues 🎉
What changed in this PR
This PR adds recovery for GitHub’s 2,500-comment issue limit in gh-aw’s maintenance scripts and no-op run reporting.
Changes:
- Detect comment-limit errors and let maintenance close affected or locked issues without posting a comment.
- Rotate full no-op trackers to a new issue and prefer the newest tracker in searches.
- Add regression tests and a patch changeset.
| File | Description |
|---|---|
actions/setup/js/handle_noop_message.test.cjs |
Tests tracker rotation and search ordering. |
actions/setup/js/handle_noop_message.cjs |
Adds tracker rollover and extracts issue creation. |
actions/setup/js/error_helpers.test.cjs |
Tests comment-limit error detection. |
actions/setup/js/error_helpers.cjs |
Adds a shared comment-limit error classifier. |
actions/setup/js/close_agentic_workflows_issues.test.cjs |
Tests continued closure and unrelated-error propagation. |
actions/setup/js/close_agentic_workflows_issues.cjs |
Allows closure when comments are blocked by limits or locks. |
.changeset/issue-comment-limit.md |
Records the fixes for a patch release. |
Review effort: Balanced (adaptive)
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs, /tdd and /codebase-design. Requesting changes on one ordering bug that can drop no-op records, plus two test gaps.
📋 Key Themes & Highlights
Key Themes
- Rotation ordering (blocking): the full tracker is closed before its replacement is created and posted. A failure in between loses the run record, which is the same class of silent loss this PR is fixing.
- Test gaps: the locked-issue skip path in the close job has no test, and the rotation test covers only the happy path.
- Structure: the rotation is nested inside a second
try, so it cannot be tested in isolation.
Positive Highlights
- ✅
isCommentLimitErroris well-scoped: it checks the 403 status and the specific message, so unrelated 403s still propagate. - ✅ Closing the full tracker as
completedand rotating viacreateAgentRunsIssue()avoids depending on the search index. - ✅ The
created descsort is a sensible tie-breaker if search lags behind the close. - ✅ Rethrow behaviour for unrelated errors is covered by a dedicated test.
Verification Limits
- The Vitest suite could not run here:
npm cifails with a self-signed certificate from the sandbox registry proxy. I validated syntax (node --check) and exercisedisCommentLimitErrordirectly across five cases (all pass). The new JS tests still need to run in CI.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~5 AIC · ⌖ ~2 AIC · ⊞ 6.7K
Comment /matt to run again
| issue_number: noopRunsIssue.number, | ||
| body: issueBody, | ||
| }); | ||
| try { |
There was a problem hiding this comment.
[/codebase-design] The nested try inside the existing try makes the rotation path hard to follow. The rotation logic only lives in the inner catch, so it cannot be exercised on its own.
💡 Suggested extraction
Move the post-or-rotate logic into a helper such as postToNoopRunsIssue(issueNumber, body) that returns the issue it posted to. The outer block then reads as a single attempt, and the rotation can be tested directly.
@copilot please address this.
| state: "closed", | ||
| state_reason: "completed", | ||
| }); | ||
| noopRunsIssue = await createAgentRunsIssue(); |
There was a problem hiding this comment.
[/diagnosing-bugs] Rotation closes the full tracker (line 400) before the replacement is created and posted. If createAgentRunsIssue() or the second createComment then fails, the outer catch only logs a warning, so the no-op record for this run is lost and the full tracker is already closed.
💡 Suggested ordering
Create and post to the replacement first, then close the old issue once the post succeeds. Capture the old number before reassigning:
const fullIssueNumber = noopRunsIssue.number;
noopRunsIssue = await createAgentRunsIssue();
await github.rest.issues.createComment({ owner, repo, issue_number: noopRunsIssue.number, body: issueBody });
// then close fullIssueNumber with state_reason completedIf the close fails after a successful post, there are briefly two open trackers, which the created desc sort already tolerates. Losing the record is the worse outcome.
@copilot please address this.
| expect(mockGithub.graphql).toHaveBeenCalledWith(CLOSE_ISSUE_MUTATION, { issueId: "I_202", stateReason: "NOT_PLANNED" }); | ||
| }); | ||
|
|
||
| it("rethrows unrelated comment failures", async () => { |
There was a problem hiding this comment.
[/tdd] The locked-issue branch added to the close job catch (isLockedError) has no test. Only the comment-limit and unrelated-403 paths are exercised.
💡 Suggested test
it("still closes issues whose comment is rejected because the issue is locked", async () => {
mockGithub.paginate.mockResolvedValueOnce([{ number: 401, title: "Locked", node_id: "I_401" }]);
mockGithub.rest.issues.createComment.mockRejectedValueOnce(Object.assign(new Error("Unable to create comment because issue is locked"), { status: 403 }));
const { main, CLOSE_ISSUE_MUTATION } = await import("./close_agentic_workflows_issues.cjs");
await main();
expect(mockCore.warning).toHaveBeenCalledWith(expect.stringContaining("#401"));
expect(mockGithub.graphql).toHaveBeenCalledWith(CLOSE_ISSUE_MUTATION, { issueId: "I_401", stateReason: "NOT_PLANNED" });
});@copilot please address this.
| expect(commentCall.body).not.toContain("Everything is up to date"); | ||
| }); | ||
|
|
||
| it("rotates to a new no-op runs issue when the existing one reached the comment limit", async () => { |
There was a problem hiding this comment.
[/tdd] The rotation test covers only the happy path. Add a failure case where the replacement issue cannot be created (the second issues.create rejects). Assert that the failure is logged as a warning, that main() resolves without throwing, and that the full tracker is not closed when no replacement exists. Under the current order, issues.update runs before create, so this test will expose the ordering issue above.
@copilot please address this.
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "ec1480b2ee0e313f5946da832e32b73b85857250",
"kind": "requested",
"schema_version": "1",
"state": "f316215cf85aa04c74d0185aa949713c145c585d9732de8ed2942620580e1baf",
"work": [
"3f34ac13af372daddbd2f9fbde159daf6ec999f3bd4d3da07ab8cf6cb621cf14",
"40d9ca880a42493de72a373db290f47b319a46fd25c5faa8c35c12b32318a6af",
"5ba7579e02f96c52b1e98ccd754254b09765a723c45f1b3fec07de4fc2f3286e",
"7c664c516154320c1d1e3d9e6a15b679a002b5822c46ed1f59ffa20452384a6e"
],
"workflow": "pr-sous-chef"
}
|
The Agentic Maintenance "Close no-repro agentic-workflows issues" job failed on
[aw] No-Op Runs(#71166): GitHub rejects new comments on issues with more than 2500 comments (403 Commenting is disabled on issues with more than 2500 comments), and the unhandled error aborted the loop. The same limit also meant the no-op handler had been silently failing to record runs, since it swallows comment errors as warnings.Changes
error_helpers.cjs: newisCommentLimitError(error)(403 + the comment-limit message).close_agentic_workflows_issues.cjs: if the "no repro" comment is rejected for the comment limit or a locked issue, log a warning and still close the issue. Other errors still propagate.handle_noop_message.cjs: when posting to the tracking issue hits the comment limit, close the full issue (completed), create a fresh[aw] No-Op Runsissue, and post there. Issue creation is split intocreateAgentRunsIssue()so rotation does not depend on the search index. The search now sorts bycreated descso the newest open tracker wins if search briefly still reports the closed one as open.Notes