From 007beaad920bc5ca21470cf88315c267167eae2c Mon Sep 17 00:00:00 2001 From: Markov Date: Fri, 27 Feb 2026 23:07:31 +0100 Subject: [PATCH] Fix infinite loop: agents ignore messages from other agents Unless explicitly @mentioned, agent skips messages where author_type=agent. Prevents two agents replying to each other forever. --- src/router.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/router.ts b/src/router.ts index edecea8..5d374a7 100644 --- a/src/router.ts +++ b/src/router.ts @@ -130,6 +130,16 @@ export class EventRouter { return; } + // Ignore messages from other agents (unless explicitly @mentioned) + // Prevents infinite reply loops between agents + if (authorType === 'agent') { + if (!content.includes(`@${this.config.slug}`)) { + this.log.info('│ Skipping agent message (not mentioned): @%s "%s"', resolvedAuthorSlug, content.slice(0, 80)); + return; + } + this.log.info('│ Processing agent message (mentioned): @%s', resolvedAuthorSlug); + } + // System messages: only process if agent is explicitly mentioned (@slug) // This lets assignment/mention notifications through, but ignores generic lifecycle events if (authorType === 'system') {