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.
This commit is contained in:
Markov 2026-02-27 23:07:31 +01:00
parent a3365848af
commit 007beaad92

View File

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