-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
Bug
The wait_for_run_to_complete MCP tool blocks indefinitely if a run never transitions to a terminal state (e.g., stuck in DEQUEUED because the dev worker isn't processing it).
This causes MCP clients (like Claude Code) to hang forever waiting for a response — in my case 19+ minutes before I manually interrupted.
Steps to reproduce
- Trigger a task via the MCP
trigger_tasktool (dev environment) - Call
wait_for_run_to_completewith the returnedrunId - If the dev worker is restarting, disconnected, or otherwise not picking up the run, it stays in
DEQUEUEDstate - The MCP tool never returns — it blocks indefinitely
Expected behavior
wait_for_run_to_complete should:
- Accept an optional
timeoutparameter (e.g., default 120s) - Return an error or status update if the timeout is exceeded (e.g.,
{ status: "DEQUEUED", error: "timeout_exceeded" })
Current behavior
The tool blocks forever with no way to set a timeout. The MCP client (Claude Code in my case) shows "Running..." indefinitely.
Environment
- Trigger.dev v4 (dev mode)
- MCP server:
@anthropic-ai/claude-codeusing Trigger.dev MCP - Worker: local dev worker (
npx trigger.dev dev)
Workaround
Avoid wait_for_run_to_complete entirely. Instead use a polling pattern:
trigger_task→ getrunIdsleep 5sget_run_details(runId)→ check status- Repeat or report stuck if still
DEQUEUEDafter ~15s
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels