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') {