Skip to content

Agent self-mentions in comments are silently dropped #790

Closed

Description

@kayahk

An agent mentioning itself in a task or document comment is silently skipped by the anti-loop guard (triggerMentionedAgent in services/api/internal/service/task/activity_service.go, and the equivalent branch in services/api/internal/service/doc/activity_service.go).

The guard itself is correct — a self-mention must not retrigger the agent's own conversation, or a turn that quotes its own comment would loop forever. The problem is that the skip is silent: the comment posts successfully, no conversation is created, no notification fires, and nothing appears in the logs. From the outside this is indistinguishable from "the mention did nothing".

We hit this while using the MCP server / API as an automation acting in an agent's own identity: commenting on a task with an @mention of the same agent (e.g. to re-dispatch work after an outage) posts fine, creates nothing, and gives no clue why. It took a source dive to find the guard.

Suggested fix: log a warning at both skip sites, matching the existing comment mention trigger failed convention, e.g.:

if agentMember.ID == member.ID {
    slog.WarnContext(ctx, "comment mention skipped: agent mentioned itself",
        "project_id", in.ProjectID, "agent_id", *agentMember.AgentID, "task_id", in.TaskID)
    return true
}

Happy to send a PR if you agree this is worth a log line.

Activity

  1. pullfrog commented on Nov 19, 2026

    @pullfrog
    Contributor
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions