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:
parent
a3365848af
commit
007beaad92
@ -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') {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user