TaskOutput with block=true fails with 'No task found' for valid background tasks

Resolved 💬 3 comments Opened Mar 5, 2026 by m3ac-AllbrittenJ Closed Mar 9, 2026

Bug Description

TaskOutput with block=true returns "No task found with ID" when called immediately after launching background tasks via run_in_background=true, even though the tasks are valid and complete successfully.

Steps to Reproduce

  1. Launch multiple background tasks using Bash with run_in_background=true
  2. Immediately call TaskOutput with block=true for the returned task IDs
  3. TaskOutput fails with: No task found with ID: <id>
  4. Shortly after, task completion notifications arrive confirming the tasks ran successfully

Expected Behavior

TaskOutput with block=true should wait for the task to appear and complete, not fail immediately if the task hasn't registered yet. Since block=true implies willingness to wait, it should handle the case where the task ID is valid but not yet registered in the task tracking system.

Actual Behavior

TaskOutput fails instantly with "No task found with ID" — a race condition between task registration and task output retrieval. Additionally, when called in parallel and the first one errors, all remaining parallel TaskOutput calls are cancelled with "Cancelled: parallel tool call TaskOutput errored".

Environment

  • Platform: Linux (WSL2)
  • Shell: nushell
  • Model: claude-opus-4-6

Additional Context

This occurred when launching 14 git clone commands in parallel as background tasks, then immediately trying to read their output. All 14 tasks completed successfully (confirmed by late-arriving notifications), but none of the TaskOutput calls succeeded.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗