@mastra/deployer 1.76.0-alpha.7 → 1.76.0-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ name: mastra-deployer
3
3
  description: Documentation for @mastra/deployer. Use when working with @mastra/deployer APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/deployer"
6
- version: "1.76.0-alpha.7"
6
+ version: "1.76.0-alpha.8"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.76.0-alpha.7",
2
+ "version": "1.76.0-alpha.8",
3
3
  "package": "@mastra/deployer",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -143,7 +143,7 @@ To add your own endpoints, see [Custom API Routes](https://mastra.ai/docs/server
143
143
 
144
144
  ## Graceful shutdown and rolling deploys
145
145
 
146
- By default, the generated server handles `SIGINT` and `SIGTERM`. It stops accepting connections, waits up to [`server.drainTimeout`](https://mastra.ai/reference/configuration) for active requests and streams, then runs `mastra.shutdown()`. Shutdown gives in-flight workflow runs (including durable agent runs) the same drain window to finish before workers and pub/sub subscriptions are torn down. The drain timeout defaults to 5 seconds. A second signal terminates the process immediately. See [`server.handleShutdownSignals`](https://mastra.ai/reference/configuration) if you need to manage signals yourself.
146
+ By default, the generated server handles `SIGINT` and `SIGTERM`. It stops accepting connections, waits up to [`server.drainTimeout`](https://mastra.ai/reference/configuration) for active requests and streams, then runs `mastra.shutdown()`. Shutdown gives in-flight workflow runs (including durable agent runs) the same drain window to finish before workers and pub/sub subscriptions are torn down. A durable agent run still executing after the window stops and releases its claim on the run, so the next boot can recover it right away. The drain timeout defaults to 5 seconds. A second signal terminates the process immediately. See [`server.handleShutdownSignals`](https://mastra.ai/reference/configuration) if you need to manage signals yourself.
147
147
 
148
148
  Increase `drainTimeout` when your hosting platform's termination grace period can accommodate longer turns. The HTTP drain and the workflow drain run one after the other, so keep enough time for both plus shutdown cleanup.
149
149
 
@@ -163,7 +163,7 @@ export const mastra = new Mastra({
163
163
  })
164
164
  ```
165
165
 
166
- A plain `agent.stream()` call can't resume after its server process exits. If a stream ends without its expected terminal event, treat the turn as interrupted and let the client retry or reconcile it. Use [durable agents](https://mastra.ai/docs/harness/durable-agents) when turns must survive process replacement. [Crash recovery](https://mastra.ai/docs/harness/durable-agents) requires shared persistent run storage and idempotent tools. Replaying missed events after a restart also requires a shared persistent cache such as Redis because the default event cache is in-memory. Multi-replica recovery doesn't yet use a distributed lease.
166
+ A plain `agent.stream()` call can't resume after its server process exits. If a stream ends without its expected terminal event, treat the turn as interrupted and let the client retry or reconcile it. Use [durable agents](https://mastra.ai/docs/harness/durable-agents) when turns must survive process replacement. [Crash recovery](https://mastra.ai/docs/harness/durable-agents) requires shared persistent run storage and idempotent tools. Replaying missed events after a restart also requires a shared persistent cache such as Redis because the default event cache is in-memory. Recovering from multiple replicas requires a storage adapter that supports run fencing or a PubSub backend whose lease every replica shares. See [multi-instance deployments](https://mastra.ai/docs/harness/durable-agents).
167
167
 
168
168
  ## Troubleshooting
169
169
 
@@ -1 +1 @@
1
- {"version":3,"file":"restart-active-runs.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/restart-active-runs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAIpC,wBAAsB,mCAAmC,CAAC,CAAC,EAAE,OAAO,qBAoBnE"}
1
+ {"version":3,"file":"restart-active-runs.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/restart-active-runs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAIpC,wBAAsB,mCAAmC,CAAC,CAAC,EAAE,OAAO,qBAsBnE"}
@@ -4032,7 +4032,7 @@ async function healthHandler(c) {
4032
4032
  async function restartAllActiveWorkflowRunsHandler(c) {
4033
4033
  try {
4034
4034
  const mastra = c.get("mastra");
4035
- mastra.restartAllActiveWorkflowRuns().catch((error) => {
4035
+ if (mastra.recoveryConfig?.workflows !== "off") mastra.restartAllActiveWorkflowRuns().catch((error) => {
4036
4036
  mastra.getLogger().error("Failed to restart active workflow runs during server startup", { error });
4037
4037
  });
4038
4038
  if (mastra.recoveryConfig?.durableAgents === "auto") mastra.recoverAllDurableAgents().catch((error) => {