Repository navigation
fix(deps): Resolve pnpm audit security advisories - #2318
Merged
Merged
Conversation
Bump shell-quote, asciinema-player, react-router-dom, and @mastra/core to patched releases, drop the unused workers-mcp dependency, and add pnpm overrides for vulnerable transitive packages that have in-range fixes. Force glob 14 under @sentry/bundler-plugin-core@4, which has no release off vulnerable glob 10. pnpm audit now reports no known vulnerabilities. Co-Authored-By: BYK <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
BYK
requested changes
Nov 17, 2026
BYK
left a comment
Member
There was a problem hiding this comment.
Forced glob 10 → 14 under @sentry/bundler-plugin-core@4 (via @sentry/vite-plugin in mcp-cloudflare). No 4.x release has a fix: 4.9.1 still depends on glob ^10.5.0. This override clears the glob, minimatch, and brace-expansion advisories, but no production build that uploads source maps has run with glob 14 yet. The other option is the major bump to @sentry/vite-plugin 5.
Prefer upgrading @sentry/vite-plugin to 5
Replace the glob override under @sentry/bundler-plugin-core@4 with an upgrade of @sentry/vite-plugin to 11.12.0, matching the other @sentry catalog pins. The 5.x line still pulls vulnerable glob 13; 11.12.0 uses @sentry/bundler-plugins with glob ^14.0.3.
BYK
approved these changes
Nov 17, 2026
BYK
enabled auto-merge (squash)
November 17, 2026 15:26
MathurAditya724
pushed a commit
that referenced
this pull request
Nov 17, 2026
Removes `@mastra/core` from the private `apps/docs-mcp` Worker. Mastra was only used there, as a wrapper around the AI SDK (`ai` 5), which the Worker already depends on. The three agents now call `generateText` directly. This drops 44 packages from the install and shrinks the Worker bundle from 14.8 MiB (2.74 MiB gzip) to 2.5 MiB (481 KiB gzip). This removes `@mastra/core`, which #2318 bumped to clear the `@modelcontextprotocol/server` advisories. With Mastra gone, docs-mcp no longer pulls `@modelcontextprotocol/server` in at all. The only copy left is the patched 2.4.0 that `@sentry/mcp-core` and `@sentry/mcp-cloudflare` depend on directly. The Worker's behavior stays the same as with Mastra 1.83.0 (what `main` runs now): same MCP tools, same `/internal/docs` API, same outputs, error messages, caching, span attributes, and metrics, and the same requests to OpenRouter. The exceptions are four deliberate differences, listed under [Accepted differences](#accepted-differences). ## What changed - **`model-fallback.ts`**: `createNativeModelFallbacks()` now returns one AI SDK model instead of a Mastra model list. On every model call it tries the primary, then `FALLBACK_MODEL`, then `KIMI_FALLBACK_MODEL`, with the same retries Mastra 1.83 did (see below). It sets `response.modelId` to the model that answered, so `getUsedModelId` and the `agent.model` span attribute keep working. When every model fails, it throws the last model's error. Like Mastra 1.83, it drops `temperature` for `openai/gpt-5.4`, which Mastra's provider registry lists as not supporting it. - **query and tailor agents**: `generateText` with `stopWhen: stepCountIs(n)` and the same model settings. The last step sends the tools with `toolChoice: "none"`. The tailor synthesis pass sends the run's response messages plus the instruction, with the tools and `toolChoice: "none"`, as Mastra 1.83 did. - **features agent**: Mastra 1.83's structured-output handling is reimplemented in `parseFeaturesOutput`. It asks for the JSON schema response format on every step and only reads steps that have text, no tool calls, and no error. It throws `Structured output was truncated because the model finished with reason "length".` for a step that was cut off. Otherwise it strips a `<|message|>` prefix or a ```` ```json ```` fence, pulls the last JSON object out of surrounding prose, escapes raw control characters, repairs partial JSON, and throws `Structured output validation failed: - path: message` on a schema mismatch. - **`tools.ts`**: the tools keep Mastra's wire format. `minLength` moves into the property description (`constraints: minimum length 1`), tool results are sent with sorted keys, and invalid tool input comes back to the model as Mastra's `{ error, message, validationErrors }` result. The comment about Mastra vendoring AI SDK schema types is gone. - Removed the `execa` Worker stub and its wrangler alias, which only Mastra needed, and updated the README. ## Retry and fallback semantics | | Mastra 1.83.0 | This PR | | --- | --- | --- | | Fallback order | Primary → `FALLBACK_MODEL` → Kimi, starting from the primary on every step | Same | | Retryable error (408, 409, 429, 5xx) on a model that isn't last | Retry the same model, at most 2 retries per step across the chain | Same | | Retry delay | 3 s, or the provider's `Retry-After` / `Retry-After-Ms` if longer, capped at 30 s | Same | | Connection reset (`ECONNRESET`, "socket hang up") | 1 s, 2 s, … backoff, capped at 30 s | Same | | Non-retryable error (such as 400) | Next model right away | Same | | Last model | Never retried, and its error is thrown | Same | | AI SDK and per-model retries | Off (`maxRetries: 0`) | Off (`maxRetries: 0`) | Example: primary 503 three times, then the fallback 503 → primary, primary +3 s, primary +6 s, fallback, Kimi. The old comment said Mastra retried each model 3 times through p-retry. In 1.83 the per-model `maxRetries: 0` turns p-retry off, and the retries above come from Mastra's step-level retry instead. I replaced the comment. ## Accepted differences BYK reviewed these four differences from Mastra 1.83.0 and accepted them as deliberate: - **Token and step counts after a retry.** In Mastra 1.83, after a step retries, the run reports 0 input and output tokens, and the retry counts as an extra step. That's a bookkeeping bug. This PR reports the real usage and step count, so `agent.tokens.*`, `agent.steps`, and their metrics only differ in runs that retried. - **Exception type.** Structured-output errors are a plain `Error` instead of `MastraError`. The message is the same, but the Sentry issue type changes. - **Logs.** Mastra's own console logs ("Upstream LLM API error", "Error in agent stream") are gone. Instead, one `[model-fallback] Error executing model …` line is logged per failed attempt. The Worker doesn't send console logs to Sentry. - **Not ported.** Mastra heuristics that this Worker isn't expected to trigger: rewriting message history for provider compatibility, assistant prefill handling, and special handling for quota-error wording. <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A78a950ae66477ad808a2d09a2706bf71 --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A78a950ae66477ad808a2d09a2706bf71) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A78a950ae66477ad808a2d09a2706bf71/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: BYK <[email protected]>
7 tasks done
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.
Fixes all 52 advisories that
pnpm auditreports on main (2 critical, 28 high, 15 moderate, 7 low), sopnpm auditnow finds none. The list comes frompnpm auditbecause Junior couldn't read the repo's Dependabot alerts, so it may not match the Dependabot alert list exactly.Review points
@sentry/vite-plugin4 → 11.12.0 (mcp-cloudflare). This matches the other@sentry/*catalog pins and shares@sentry/[email protected]with@sentry/cloudflare. The 5.x line still pulls vulnerableglob13, so 11.x is the first release that clears the glob advisories without an override. The existingsentryVitePlugin({ org, project })config works unchanged, and builds still inject debug IDs.@mastra/core1.63 → 1.83 (apps/docs-mcp). The range is^1.68.0, which resolves to 1.83.0. The newer versions no longer depend on the vulnerable@modelcontextprotocol/[email protected].Advisories fixed
packages/cli^1.11.0asciinema-player^3.18.1, override raised toseroval: ^1.6.11@mastra/core^1.68.0workers-mcpdependency and catalog entry frommcp-cloudflare(nothing imports it)@sentry/vite-plugin4.6.1 → 11.12.0react-router-dom^7.18.2browserslist: ^4.28.7defu: ^6.1.5"path-to-regexp@8": ^8.4.0source-map-js: ^1.2.2"fast-uri@3": ^3.1.9replaces the[email protected]>fast-uripinmdast-util-to-hast: ^13.2.1"postcss-selector-parser@6": ^6.1.5"@ai-sdk/provider-utils@4": ^4.0.33"@babel/core@7": ^7.29.6"diff@8": ^8.0.3All existing overrides stay, including
zod: ^4.6.6.via @BYK.
--
View Session [Sentry]