Skip to content

Handle GitHub's 2500-comment issue limit in maintenance and no-op tracker - #79689

Merged
pelikhan merged 2 commits into
mainfrom
pelikhan/psychic-journey
Nov 21, 2026
Merged

pelikhan merged 2 commits into
mainfrom
pelikhan/psychic-journey

Conversation

@pelikhan

Copy link
Copy Markdown
Collaborator

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: new isCommentLimitError(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 Runs issue, and post there. Issue creation is split into createAgentRunsIssue() so rotation does not depend on the search index. The search now sorts by created desc so the newest open tracker wins if search briefly still reports the closed one as open.

Notes

  • Includes a patch changeset.
  • Tests added for the helper, the close-script skip/rethrow paths, and no-op issue rotation.

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]>
@pelikhan
pelikhan marked this pull request as ready for review November 21, 2026 04:46
Copilot AI adaptive review requested due to automatic review settings November 21, 2026 04:46
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~5 AIC · ⌖ ~2 AIC · ⊞ 6.7K · ◷

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt56 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.6K · ◷

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

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.

🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ⊞ 7.3K · ◷

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

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.

Generated by Ponytail Reviewer for #79689 · codex · routed: gpt61 medium · ~5 AIC · ⌖ ~1 AIC · ⊞ 185 · ◷

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

PR Specification Reviewer

Outcome: reported_action

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.

Generated by PR Specification Reviewer for #79689 · copilot · gpt56 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.7K · ◷

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-11-21T04:48:54Z
review_event: REQUEST_CHANGES
top_themes: [lossy tracker rollover, concurrent duplicate trackers]
files_reviewed: [actions/setup/js/handle_noop_message.cjs, actions/setup/js/error_helpers.cjs, actions/setup/js/close_agentic_workflows_issues.cjs]
comment_count: 2
History

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.6K · ◷
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (review-history)
{"id":"ldg-1ff1047a-852e-4b5f-b24b-94b12d2118d7","parents":[],"payload":{"id":"ldg-18c1800f-34e5-48d9-839b-7fb4e6acaaad","operation":"append","value":{"finding_count":2,"head_sha":"5ddf7ef473b8eeee0ee6bceb9b027dd7dd437c3d","outcome":"findings"}},"sha":"sha256:38d64cb6c990c61813f434e1efd9f8fb3660bb71243450cff811f74787d8afc7","timestamp":"2026-11-21T04:52:51.702Z","type":"ledger_append","version":1}
History

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (spec-review-history)
{"id":"ldg-e11c0e9e-9b83-4020-98ca-55438cea2e68","parents":[],"payload":{"id":"ldg-9089ff4b-66c3-4cef-9f59-e5e28d7c1949","operation":"append","value":{"finding_count":0,"head_sha":"5ddf7ef473b8eeee0ee6bceb9b027dd7dd437c3d","outcome":"aligned"}},"sha":"sha256:bfe6744baa02e7457e49aa6d5b109c1a9076f72cc8154a20e709d76084b8387d","timestamp":"2026-11-21T04:53:49.106Z","type":"ledger_append","version":1}
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]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  • ✅ isCommentLimitError is well-scoped: it checks the 403 status and the specific message, so unrelated 403s still propagate.
  • ✅ Closing the full tracker as completed and rotating via createAgentRunsIssue() avoids depending on the search index.
  • ✅ The created desc sort 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 ci fails with a self-signed certificate from the sandbox registry proxy. I validated syntax (node --check) and exercised isCommentLimitError directly 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 {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/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();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/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 completed

If 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 () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/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 () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/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.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/js/handle_noop_message.cjs:387): address unresolved feedback - Review comment
  3. Review (actions/setup/js/handle_noop_message.cjs:407): address unresolved feedback - Review comment
  4. Review (actions/setup/js/close_agentic_workflows_issues.test.cjs:87): address unresolved feedback - Review comment
  5. Review (actions/setup/js/handle_noop_message.test.cjs:732): address unresolved feedback - Review comment

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"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~2 AIC · ⌖ ~2 AIC · ⊞ 7K · ◷
Comment /souschef to run again

@pelikhan
pelikhan merged commit 521c9f4 into main Nov 21, 2026
45 of 46 checks passed
@pelikhan
pelikhan deleted the pelikhan/psychic-journey branch November 21, 2026 05:43
Copilot stopped work on behalf of gh-aw-bot due to an error November 21, 2026 05:44
Copilot AI requested a review from gh-aw-bot November 21, 2026 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants