Mastra idleTimeoutMs observer detach: the Sume job keeps running
Mastra idleTimeoutMs detaches the observer and keeps the run. A Sume job it started keeps running too: re-wait on its id, do not resubmit.

A Mastra release changed what happens when idleTimeoutMs fires without an isAlive probe: the observer now detaches, and the run's registry entry and cached events are kept. A Sume job started by that run is not touched either way. It keeps running and billing until it finishes or you call jobs_cancel.
Vendor facts are from the Mastra releases page; Sume facts from Jobs and results and MCP tools and gates, read 2026-10-01.
What does the Mastra note say?
Before, a quiet but still-running run, such as one waiting on a slow tool, was cleaned up. Now it is kept. The note says that if you rely on the idle timeout to clean up runs whose process crashed, you should pass isAlive so cleanup happens only when the run reports itself not alive.
What does that leave on the Sume side?
Three separate states can exist after a detach.
| State | Behavior |
|---|---|
| Mastra run entry | Kept after detach per the release note |
| Sume job | A client-side timeout does not cancel it; it keeps running and still bills |
| Sume wait | At most 55 seconds per call; on wait_slice_expired retry jobs_wait with the same ids |
| Stop | jobs_cancel is the explicit write tool and needs an idempotency_key |
How do I reattach?
Keep the job ids from the create result in the run state. After the observer detaches, call jobs_wait with the same ids. The docs say never to resubmit the paid create, so a second run that sees an existing id should wait on it. For the lease pattern in Mastra, see Mastra background tasks and Sume job leases.
When should I cancel instead?
If the run was abandoned on purpose, cancel its jobs; otherwise they continue to bill. jobs_cancel needs write access (mcp:write or an API key). Read tools such as jobs_status and jobs_result do not.
Sources
Related posts
More in Integrations
- Mastra respondToToolApproval needs toolCallId: Sume paid calls
Mastra now rejects approval responses without toolCallId. When you approve a Sume paid tool call, key it to that id and keep its idempotency_key stable.
- OpenAI Agents Python conditional approval and Sume dry_run
Openai-agents-python v0.22.3 aligns conditional approvals with validated tool arguments. For Sume tools, base the check on tools_schema and dry_run.
- Snapchat Ads MCP and hosted Sume tools in one agent
Snap's Ads MCP server answers campaign questions and is read-only at launch. Add Sume's hosted MCP in the same agent to turn the findings into creative.
- Tavus PAL MCP connectors vs Sume hosted MCP tools and gates
Tavus MCP connectors let a PAL call third-party MCP servers. Here is what Sume's hosted MCP at mcp.sume.com exposes and the gates a paid call needs.
Written by Sume