Repository navigation
ref(mcp,cli): Take Seer 402/409 codes from @sentry/api - #2243
Open
sentry-junior[bot] wants to merge 1 commit into
Open
sentry-junior[bot] wants to merge 1 commit into
sentry-junior[bot] wants to merge 1 commit into
Conversation
Bump @sentry/api to 2.1.0, which documents the 402 and 409 error bodies of the Autofix start endpoint (getsentry/sentry#131067). The CLI and MCP now key their Seer code maps by the generated AutofixPaymentRequiredResponse and AutofixConflictResponse types instead of hardcoding the codes. A code added to or renamed in the schema now fails type-checking until it is handled. seer_out_of_quota is mapped explicitly; its behavior is unchanged. @sentry/api 2.0.1 keeps per_page stable across a list walk so Sentry's OffsetPaginator doesn't drop rows. The listOrganizations/listTeams/ listProjects pagination tests now model OffsetPaginator cursors and check that the returned cursor resumes at the first row not returned. Closes #2234 Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2234.
@sentry/api2.1.0 now includes the 402 and 409 error bodies of the Autofix start endpoint, from getsentry/sentry#131067:AutofixPaymentRequiredResponse:codeisseer_out_of_creditsorseer_out_of_quota.AutofixConflictResponse: optionalcode, one ofscm_integration_required,repos_not_linkedorrun_in_flight.This bumps the catalog from 2.0.0 to 2.1.0 and stops hardcoding those codes.
CLI
formatters/seer.ts:OUT_OF_CREDITS_CODEandSETUP_REQUIRED_REASONSbecome exhaustiveRecords keyed by the generated code unions. They arePAYMENT_REQUIRED_REASONSandCONFLICT_REASONS, andrun_in_flightmaps tonull.errors.ts: the setup reasons inSeerErrorReasonnow come fromAutofixConflictResponse["code"]viaSeerSetupRequiredCode.MCP
tool-helpers/seer.ts: the out-of-credits check and the setup-required code set follow the same pattern.Why
Records: if the schema adds or renames a code, type-checking fails until the code is handled. Removingrun_in_flightfrom the MCP map, for example, givesTS2741: Property 'run_in_flight' is missing.Behavior: unchanged.
seer_out_of_quotais now mapped explicitly, but it lands where it already did:no_budgetin the CLI, and the quota message in the MCP. Lookups useObject.hasOwn, so a body whosecodehappens to beconstructorortoStringdoesn't match a prototype key. New tests cover that.Pagination tests: the bump also pulls in @sentry/api 2.0.1's fix that keeps
per_pagethe same for every page of a list walk (getsentry/sentry-api-schema#149). Sentry'sOffsetPaginatorcursor is<page size>:<page>:<is_prev>, so changingper_pagepartway through a walk dropped rows. Threeclient.test.tspagination tests used numeric row-offset cursors and expected page sizes like[100, 100, 5]. They now modelOffsetPaginatorcursors and expect even pages,[69, 69, 69]for 205 rows and[67, 67, 67]for 201. ThelistOrganizationstest also checks that the returned cursor resumes at the first row not returned (org-205), partway through the last page.Verification
pnpm install --frozen-lockfilepasses. The lockfile was edited by hand because the release-age policy flags the old 2.0.0 entries.pnpm run tscandpnpm run lintpass.mcp-corevitest: 2311 passed.toolkit-core: 138 passed.test/lib test/commands test/types test/script): 83 tests fail in this sandbox, and they are the same 83 that fail onmainhere, compared file by file. CI is the real check.No UI change.
--
View Session [Sentry]