Skip to content

[Feature] Let an assigned agent react to new comments on its task #841

Done

Description

@sebathi

Summary

An agent assigned to a task only picks up new comments when it is @-mentioned in them. Being the assignee has no effect after the initial task_assigned trigger.

Problem

In services/api/internal/service/task/activity_service.go, handleMentions is the only path from a comment to an agent, and it looks at mentions alone; it never checks the task's assignees. In practice the workflow with an agent on a task is: comment, remember to tag the agent, and if you forget, nothing happens. A human assignee readsthe comments on their task; an agent assignee does not.

The existing workaround is an automation (comment_added → condition assignee_ids contains <agent> → trigger_ai_agent). Two things make it hard to use:

  • The automation consumer only skips origin=automation events. The agent's own reply comment has origin=agent, so it fires comment_added again, and conditions can't filter by comment author. The result is an agent answering itself in a loop.
  • wait delays each walk but doesn't coalesce. Three comments in two minutes become three conversations, queued by parallelism_limit.

Proposed solution

A per-agent setting, off by default, e.g. react_to_comments_on_assigned_tasks:

  • A comment by a human (not an agent, not an automation) on a task where the agent is an assignee triggers a comment_mention-style conversation, unless the comment already mentions the agent (which triggers today).
  • A coalescing window (fixed, or a second setting in minutes): comments on the same task within the window start one conversation whose prompt carries all of them.
  • If the agent already has a running conversation on that task, either append to it or queue, following whatever dispatchOrEnqueue does today.

Was leaving this out deliberate (cost per container run, loop concerns)? If so, I'd rather align on the shape before writing code. Happy to send a PR once there's agreement.

Alternatives considered

  • Automation as above: works only if the agent never comments back, and can't coalesce.
  • Skipping origin=agent comments in the automation consumer: fixes the loop for everyone using that automation, but still no coalescing and still per-project setup.
  • Making it the default: changes behaviour for every existing assigned agent; opt-in seems safer.

Area

Product behavior

Additional context

services/api (agent triggers, automation consumer)

Activity

  1. added
    enhancement
    on Nov 30, 2026
  2. pullfrog commented on Nov 30, 2026

    @pullfrog
    Contributor
  3. added
    good first issue
    on Nov 30, 2026
  4. sebathi commented on Nov 30, 2026

    @sebathi
    ContributorAuthor

    If you think this is suitable, I can make a PR to implement it.

  5. added a commit that references this issue on Dec 2, 2026
    33d226f
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

    enhancementgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions