You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tasks: comment POST waits for agent notification delivery before returning #4675
confirmed-reproBug reproduced again from a clean trusted checkout; see linked reportperfpluginsPlugin SDK, runtime, marketplacetasksBuilt-in plugin: tasks
createComment in the Tasks plugin waits for notification delivery before it returns. When notify is set, a comment POST from the UI does not return until deliverCommentToLatestAgent has run threads.get, and then threads.send (steer-if-active) to the task's latest agent thread. The comment is already committed by then, but the UI and comments:changed both wait. On a busy server, or when that agent thread is mid-turn and expensive to touch, adding a comment visibly hangs.
Where
plugins/tasks/api/index.ts, createComment (upstream 049d6a932, line 414). The code inserts the comment, then runs await deliverCommentToLatestAgent(...), then updateComment(notifiedCount). It calls publishCommentsChanged only after that.
Expected
The comment is returned and comments:changed is published as soon as the insert commits. Delivery runs afterwards, and notifiedCount is updated, with a second comments:changed, when delivery finishes. A delivery failure is logged and leaves notifiedCount at 0, as it does today.
The CLI's bb tasks comment --notify --json reports notifiedCount, so it may still want to wait. An awaitDelivery option on the internal call covers both cases.
We have a patch for this in our fork with tests. These cover a hung threads.send not blocking the response, and a failed send leaving notifiedCount at 0. Happy to open a PR if wanted.
Related
listComments also awaits threads.get for each distinct agent thread, plus providers.list, before it returns. That makes opening a task with many agent comments slow for the same reason. We have not changed this yet.
Root cause: The comment commits before thread notification, but its RPC response and initial change event await delivery. Blocked lookup/send regressions fail before the fix and pass afterward.
Fix:Return saved task comments before agent delivery completes #4679 — ready, not merged. Returns/publishes the saved comment immediately, updates notification status afterward, and preserves CLI waiting. Five files, 164 changed text lines; all 411 Tasks tests pass, with focused composer verification and passing lint/typecheck.
confirmed-reproBug reproduced again from a clean trusted checkout; see linked reportperfpluginsPlugin SDK, runtime, marketplacetasksBuilt-in plugin: tasks
Activity
bb-slop-cop commentedon Oct 2, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotplugins,tasks,perf,confirmed-repro.