Skip to content

Tasks: comment POST waits for agent notification delivery before returning #4675

Closed

Description

@mistakeknot

Summary

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.

Activity

  1. added theissue type on Oct 2, 2026
  2. added
    plugins
    tasks
    confirmed-repro
    on Oct 2, 2026
  3. bb-slop-cop commented on Oct 2, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    AGENT GENERATED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-reproperfpluginstasks

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions