Skip to content

Commit 94b4712

Browse files
dcramercodex
andcommitted
fix(update-issue): Prefer archived_forever over stale details
Treat archived_forever as authoritative the same way we already treat until-escalating ignores. This prevents stale condition fields in serialized statusDetails from being misread as a condition-based snooze and keeps forever no-op updates idempotent. Co-Authored-By: Codex <codex@openai.com>
1 parent 2493105 commit 94b4712

2 files changed

Lines changed: 50 additions & 0 deletions

File tree

‎packages/mcp-core/src/tools/update-issue.test.ts‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,48 @@ describe("update_issue", () => {
641641
expect(result).toContain("**Ignore Behavior**: Forever");
642642
});
643643

644+
it("treats archived_forever as authoritative over stale ignore details", async () => {
645+
let putCalled = false;
646+
const currentIssue = createIssue({
647+
status: "ignored",
648+
substatus: "archived_forever",
649+
statusDetails: {
650+
ignoreCount: 3,
651+
},
652+
});
653+
654+
mswServer.use(
655+
http.get(
656+
"https://sentry.io/api/0/organizations/sentry-mcp-evals/issues/CLOUDFLARE-MCP-41/",
657+
() => HttpResponse.json(currentIssue),
658+
),
659+
http.put(
660+
"https://sentry.io/api/0/organizations/sentry-mcp-evals/issues/CLOUDFLARE-MCP-41/",
661+
() => {
662+
putCalled = true;
663+
return HttpResponse.json(currentIssue);
664+
},
665+
),
666+
);
667+
668+
const result = await updateIssue.handler(
669+
{
670+
organizationSlug: "sentry-mcp-evals",
671+
issueId: "CLOUDFLARE-MCP-41",
672+
status: "ignored",
673+
ignoreMode: "forever",
674+
assignedTo: undefined,
675+
issueUrl: undefined,
676+
regionUrl: null,
677+
},
678+
serverContext,
679+
);
680+
681+
expect(putCalled).toBe(false);
682+
expect(result).toContain("No changes were needed.");
683+
expect(result).toContain("**Ignore Behavior**: Forever");
684+
});
685+
644686
it("validates required parameters", async () => {
645687
await expect(
646688
updateIssue.handler(

‎packages/mcp-core/src/tools/update-issue.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,14 @@ function getIgnoreState(
229229
};
230230
}
231231

232+
if (issue.substatus === "archived_forever") {
233+
return {
234+
family: "forever",
235+
behavior: "Forever",
236+
message: "The issue is now ignored indefinitely",
237+
};
238+
}
239+
232240
if (ignoreUntil) {
233241
const formattedIgnoreUntil = formatIgnoreUntil(ignoreUntil);
234242
return {

0 commit comments

Comments
 (0)