Skip to content

Commit 4314944

Browse files
fix(signals): remove unreachable OpenPrWorkClassification stale (#7471)
Closes #7448 Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent dc9768f commit 4314944

4 files changed

Lines changed: 7 additions & 10 deletions

File tree

src/services/agent-orchestrator.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,6 @@ function buildOpenPrMonitorActions(run: AgentRunRecord, pack: ContributorDecisio
412412
"needs_author",
413413
"failing_checks",
414414
"duplicate_prone",
415-
"stale",
416415
"should_close_or_withdraw",
417416
"blocked",
418417
]);

src/signals/contributor-open-pr-monitor.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { isTestPath } from "./test-evidence";
1818
export type OpenPrWorkClassification =
1919
| "approved"
2020
| "blocked"
21-
| "stale"
2221
| "needs_author"
2322
| "failing_checks"
2423
| "missing_tests"
@@ -112,7 +111,7 @@ export async function buildContributorOpenPrMonitor(env: Env, login: string): Pr
112111
packets.sort((left, right) => priorityRank(left.classification) - priorityRank(right.classification) || left.repoFullName.localeCompare(right.repoFullName) || left.number - right.number);
113112

114113
const cleanupFirst = packets.some((entry) =>
115-
["needs_author", "failing_checks", "duplicate_prone", "stale", "should_close_or_withdraw", "blocked"].includes(entry.classification),
114+
["needs_author", "failing_checks", "duplicate_prone", "should_close_or_withdraw", "blocked"].includes(entry.classification),
116115
);
117116
const approvedCount = packets.filter((entry) => entry.classification === "approved").length;
118117
const summary = summarizeMonitor(openByContributor.length, approvedCount, cleanupFirst);
@@ -183,7 +182,6 @@ function nextStepsForClassification(classification: OpenPrWorkClassification, re
183182
return [`Add or update tests on ${ref} if the repo expects test coverage.`, `Note test commands run in the PR description.`];
184183
case "duplicate_prone":
185184
return [`Check overlap with other open PRs in ${repoFullName}; close or consolidate duplicates.`, `Comment on ${ref} linking the canonical PR if one exists.`];
186-
case "stale":
187185
case "should_close_or_withdraw":
188186
return [`Update ${ref} with a short status comment or close it if no longer needed.`, `Do not open new work until stale queue pressure is reduced.`];
189187
case "maintainer_lane":
@@ -281,7 +279,6 @@ function priorityRank(classification: OpenPrWorkClassification): number {
281279
"missing_tests",
282280
"blocked",
283281
"should_close_or_withdraw",
284-
"stale",
285282
"draft",
286283
"reviewable",
287284
"approved",

test/unit/agent-orchestrator.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ describe("agent orchestrator", () => {
235235
repoFullName: "private-org/secret-alpha",
236236
number: 77,
237237
title: "secret-alpha patch",
238-
classification: "stale",
239-
summary: "secret-alpha patch is stale.",
238+
classification: "should_close_or_withdraw",
239+
summary: "secret-alpha patch should be closed or withdrawn.",
240240
reasons: ["No updates in 30 days."],
241241
nextSteps: ["Privately prioritize the secret-alpha patch before opening more public work."],
242242
},
@@ -556,8 +556,8 @@ describe("agent orchestrator", () => {
556556
repoFullName: "owner/ready",
557557
number: 9,
558558
title: "Stale fix",
559-
classification: "stale",
560-
summary: "PR is stale.",
559+
classification: "should_close_or_withdraw",
560+
summary: "PR should be closed or withdrawn.",
561561
reasons: ["No updates in 30 days."],
562562
nextSteps: ["Rebase or close the PR."],
563563
},

test/unit/contributor-open-pr-monitor.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,10 +346,11 @@ describe("contributor open PR monitor", () => {
346346
]),
347347
);
348348

349+
// Every live OpenPrWorkClassification value must have next-steps guidance. "stale" was removed (#7448):
350+
// mapPendingClassToWorkClassification never produced it (upstream stale_likely_close → should_close_or_withdraw).
349351
for (const classification of [
350352
"reviewable",
351353
"blocked",
352-
"stale",
353354
"draft",
354355
"maintainer_lane",
355356
"missing_tests",

0 commit comments

Comments
 (0)