You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(agent-actions): close every over-cap sibling issue, not just the incoming one (#2493)
Same delivery-order gap as #2479, mirrored for issues: closing only "the
incoming issue, if it's over cap" let an older sibling's stale verdict
(computed before a newer sibling existed in the DB) stand forever, since
nothing else ever re-evaluates an issue. Now closes every number in the
over-cap set discovered by the current delivery. Unlike the PR path,
issues have no live-head/CI staleness risk to guard against and no
issue-side "regate" job type to reuse, so acting directly on the
already-fetched snapshot is safe.
Also fixes the codecov/patch gap the gate flagged on this PR: adds
coverage for the label ?? "" fallback, the no-slash repoFullName guard,
and an author-less (ghost) sibling issue.
it("contributor open-ISSUE cap (#2270): a slash-free repoFullName is safely planned (repoOwner computation guard) even though the GitHub call itself can never succeed against that name", async () => {
6164
+
// A real webhook always carries "owner/repo"; this pins the DEFENSIVE repoFullName.includes("/") ? ... : ""
6165
+
// fallback (mirroring the PR path's own such guard) against a malformed value WITHOUT crashing the cap
6166
+
// computation. The actual close attempt legitimately errors — splitRepo() (shared by every GitHub-action
6167
+
// primitive) rejects any repoFullName that isn't "owner/repo" — and that error is caught and audited, not
6168
+
// thrown into the webhook handler; a successful close against a slash-free name is not physically possible
6169
+
// via the real GitHub REST API, so asserting an audited error (not a crash) is the correct expectation.
const closeAudit = await env.DB.prepare("select outcome, detail from audit_events where event_type = 'agent.action.close' order by created_at desc limit 1").first<{ outcome: string; detail: string }>();
6200
+
expect(closeAudit?.outcome).toBe("error");
6201
+
expect(closeAudit?.detail).toMatch(/Invalid repository full name/);
6202
+
});
6203
+
6204
+
it("contributor open-ISSUE cap (#2270): an author-less (ghost) open issue among the repo's others is excluded from the count, not crashed on", async () => {
0 commit comments