Repository navigation
Description
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=automationevents. The agent's own reply comment hasorigin=agent, so it firescomment_addedagain, and conditions can't filter by comment author. The result is an agent answering itself in a loop. waitdelays each walk but doesn't coalesce. Three comments in two minutes become three conversations, queued byparallelism_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
dispatchOrEnqueuedoes 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=agentcomments 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
pullfrog commentedon Nov 30, 2026
sebathi commentedon Nov 30, 2026
If you think this is suitable, I can make a PR to implement it.
Let assigned agents react to comments on their tasks