Skip to content

fix: bound durable Inngest stream memory usage - #21572

Open
mastra-platform[bot] wants to merge 1 commit into
mainfrom
factory/issue-20668
Open

fix: bound durable Inngest stream memory usage#21572
mastra-platform[bot] wants to merge 1 commit into
mainfrom
factory/issue-20668

Conversation

@mastra-platform

Copy link
Copy Markdown
Contributor

Summary

  • close Inngest realtime subscriptions through the SDK lifecycle handle so WebSockets and fanout buffers are released
  • keep internal workflow.events.v2.* watch events live while excluding them from durable replay caches
  • preserve the durable step-start chunk shape while replacing full model request payloads with an empty request object
  • add regression coverage and patch changesets for @mastra/inngest and @mastra/core

Fixes #20668.

Test plan

  • pnpm --filter @mastra/inngest exec vitest run src/realtime-subscription.test.ts src/__tests__/create-inngest-agent.test.ts --reporter=dot --bail 1
  • pnpm --filter @mastra/core exec vitest run src/agent/durable/step-start-chunk-shape.test.ts --reporter=dot --bail 1
  • pnpm --filter @mastra/inngest lint
  • pnpm --filter @mastra/inngest build
  • pnpm build:core
  • pnpm --filter ./packages/core check
  • git diff --check

Close realtime subscriptions at the SDK lifecycle boundary, keep internal workflow watch events out of replay caches, and avoid publishing full model requests in durable step-start chunks.

Co-Authored-By: Mastra Code (openai/gpt-5.6-sol) <noreply@mastra.ai>
@vercel

vercel Bot commented Aug 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mastra-docs-1.x Ready Ready Preview Aug 15, 2026 5:24am
mastra-playground-ui Ready Ready Preview Aug 15, 2026 5:24am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
mastra-studio-preview Ignored Ignored Aug 15, 2026 5:24am

Request Review

@changeset-bot

changeset-bot Bot commented Aug 15, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 84e1040

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 26 packages
Name Type
@mastra/core Patch
@mastra/inngest Patch
@mastra/code-sdk Patch
mastracode Patch
@mastra/factory Patch
@mastra/mcp-docs-server Patch
@internal/playground Patch
@mastra/client-js Patch
@mastra/opencode Patch
@mastra/longmemeval Patch
mastra Patch
@mastra/deployer-cloud Patch
@mastra/react Patch
@mastra/playground-ui Patch
@mastra/server Patch
@mastra/deployer Patch
create-mastra Patch
create-factory Patch
@mastra/express Patch
@mastra/fastify Patch
@mastra/hono Patch
@mastra/koa Patch
@mastra/nestjs Patch
@mastra/next Patch
@mastra/tanstack-start Patch
@mastra/temporal Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dane-ai-mastra dane-ai-mastra Bot added the complexity: low Low-complexity PR label Aug 15, 2026
@dane-ai-mastra

Copy link
Copy Markdown
Contributor

PR triage

Linked issue check skipped for excluded profile @mastra-platform[bot].


PR complexity score

Factor Value Score impact
Files changed 9 +18
Lines changed 210 +12
Author merged PRs 54 -20
Test files changed Yes -10
Final score 0

Applied label: complexity: low


Changed test gate

Changed Test Gate is pending. The Changed Test Gate / changed-tests check will update the test label when it completes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

complexity: low Low-complexity PR tests: failing ❌ Changed tests passed against base

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Durable agent stream consumers retain every run event (SDK stream leak + dead watch-event cache), OOMing Cloudflare Workers isolates

1 participant