Skip to content

fix(update-issue): align ignore operations with Sentry - #903

Merged
dcramer merged 7 commits into
mainfrom
dcramer/fix/update-issue-ignore-operations
Apr 15, 2026
Merged

dcramer merged 7 commits into
mainfrom
dcramer/fix/update-issue-ignore-operations

Conversation

@dcramer

@dcramer dcramer commented Apr 15, 2026

Copy link
Copy Markdown
Member

Align update_issue ignore operations with the Sentry issue update schema so ignored issues use the same substatus and condition fields as the product. The MCP tool now defaults ignored issues to "until escalating", exposes explicit ignore modes for forever, duration, occurrence count, and user count, and reports the resulting ignore behavior back in the tool response.

This replaces the earlier statusDetails.ignoreUntilEscalating shortcut, which did not match the server-side schema and made ignored updates ambiguous for the model. The schema, API client, mocks, tests, and eval coverage now all use the same structured ignore inputs so the LLM can choose the right operation without inferring undocumented payload shapes.

I also trimmed the tool description so the generated definitions stay under the tool description limit while still steering the model toward the new ignore fields.

Validation: pnpm run tsc and pnpm run lint passed. pnpm run test still fails only in packages/mcp-core/src/internal/agents/openai-provider.integration.test.ts, where the current local env resolves an invalid OpenAI API key; the update_issue tests, tools.test.ts, and pnpm --filter @sentry/mcp-server-evals exec tsc -b all passed.

Fixes #878
Fixes #873

Map ignored issue updates to Sentry's real issue schema instead of the old statusDetails shortcut. Default ignored issues to until escalating and expose explicit ignore modes for forever, duration, occurrence count, and user count.

Add handler tests, eval coverage, and mock support for the new ignore modes. Trim the tool description so the generated definition stays within the tool description limit.

Fixes #878
Fixes #873
Co-Authored-By: Codex <codex@openai.com>
Comment thread packages/mcp-core/src/api-client/client.ts
@dcramer
dcramer marked this pull request as ready for review April 15, 2026 17:08
Comment thread packages/mcp-core/src/api-client/client.ts
Comment thread packages/mcp-core/src/api-client/client.ts
Read ignored issue behavior from persisted statusDetails so condition-based snoozes keep their real rule in update output. Reject unsupported cross-family ignored-to-ignored mode switches instead of claiming they succeeded, and avoid redundant ignored updates that can mutate existing snoozes.

Add regression coverage for assignment-only updates on ignored issues, allowed condition-to-condition changes, rejected cross-family switches, and the already-ignored no-op path.

Refs #878
Co-Authored-By: Codex <codex@openai.com>
Comment thread packages/mcp-core/src/tools/update-issue.ts Outdated
Comment thread packages/mcp-server-mocks/src/index.ts Outdated
Avoid treating assignedTo as a change signal when the requested assignee is already set. This keeps update_issue idempotent for existing assignees, skips redundant API calls when the request can be proven to be a no-op, and stops the change summary from implying an assignment change that never happened.

Add regression coverage for the same-assignee no-op path alongside the existing ignore-mode tests.

Refs #878
Co-Authored-By: Codex <codex@openai.com>
Comment thread packages/mcp-server-mocks/src/index.ts Outdated
Handle update_issue as a state-matching tool instead of assuming every requested status or ignore payload implies a real mutation. Short-circuit requests that already match the persisted issue state, including resolvedInNextRelease and condition-based ignore rules, and report status transitions using the serialized state Sentry actually returns.

Add regression coverage for same-status no-ops, resolvedInNextRelease transitions, and repeated condition-based ignore requests so we do not regress on the same class of review findings.

Refs #878
Co-Authored-By: Codex <codex@openai.com>
Extract the shared issue update mock response builder so the four PUT handlers stay in sync as update_issue evolves. Also fix the ignored default to match Sentry's until-escalating behavior and model resolvedInNextRelease the way the real API serializes it.

Refs #878
Co-Authored-By: Codex <codex@openai.com>
Comment thread packages/mcp-core/src/tools/update-issue.ts
Drop the unreachable already-ignored branch that tried to short-circuit non-condition ignore updates after the identical-behavior no-op check had already handled them. This keeps the transition logic smaller without changing behavior.

Refs #878
Co-Authored-By: Codex <codex@openai.com>

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2493105. Configure here.

Comment thread packages/mcp-core/src/tools/update-issue.ts
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>
@dcramer

dcramer commented Apr 15, 2026

Copy link
Copy Markdown
Member Author

This is exposing more copmlexity than I'd like to LLMs, but for now we'll move forward

@dcramer
dcramer merged commit a2ee62a into main Apr 15, 2026
16 checks passed
@dcramer
dcramer deleted the dcramer/fix/update-issue-ignore-operations branch April 15, 2026 20:05

This branch was previously deployed

1 inactive deployment
Actions — 94b4712d Deployed Apr 15, 2026 by dcramer via eval #804
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.

update_issue with status: ignored defaults to archived_forever instead of archived_until_escalating update_issue misleading ignore options / wording

1 participant