0
Fork 0
mirror of https://github.com/mastra-ai/mastra.git synced 2026-11-17 08:44:46 +00:00

fix(mcp): address review of background-task MCP tasks

- Cancelling or expiring an 'auto' task whose row waits for a slot now
  aborts the attempt already running under its request; the manager
  never started it, so it could not abort it.
- The sweeper dispatches unowned pending rows older than a lease: a
  task queued on an instance that died was otherwise stranded until a
  restart, since the manager only dispatches such rows at start-up.
- Rows carry the tool as mcp-server:<id>:<tool>, so core's bare-name
  executor fallback can never run a Mastra tool named like the MCP tool
  with the task's arguments; an unserved row fails instead.
- tasks/update errors instead of acknowledging an answer storage
  refused to store.
- A failed store choice (storage unreachable) is no longer memoized as
  in-memory; the next request chooses again.
- The sweeper starts on the first task request, not at registration.
- Warn when tasks are stored under an id generated for this process.
- Docs: what recover: true retries, and what ttlMs: null means in storage.

Co-Authored-By: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
This commit is contained in:
Daniel Lew 2026-10-26 19:50:33 -04:00
commit 67d678751c
6 changed files with 276 additions and 27 deletions