From fc86592a73aa5abbb7a593963e52aa925a579e5e Mon Sep 17 00:00:00 2001 From: Markov Date: Fri, 27 Feb 2026 08:00:00 +0100 Subject: [PATCH] Refine: system messages pass only if agent @mentioned (not blanket ignore) --- src/router.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/router.ts b/src/router.ts index 544ecaa..ebf095f 100644 --- a/src/router.ts +++ b/src/router.ts @@ -79,18 +79,22 @@ export class EventRouter { return; } - // Ignore system messages — they are lifecycle notifications, not user input - if (authorType === 'system') { - this.log.info('│ Skipping system message: "%s"', content.slice(0, 100)); - return; - } - // Ignore own messages (agent talking to itself) if (resolvedAuthorSlug === this.config.slug) { this.log.info('│ Skipping own message'); return; } + // System messages: only process if agent is explicitly mentioned (@slug) + // This lets assignment/mention notifications through, but ignores generic lifecycle events + if (authorType === 'system') { + if (!content.includes(`@${this.config.slug}`)) { + this.log.info('│ Skipping system message (not mentioned): "%s"', content.slice(0, 100)); + return; + } + this.log.info('│ Processing system message (mentioned): "%s"', content.slice(0, 100)); + } + // Build context-rich prompt for the agent const ctx = taskId ? `[задача ${taskKey || taskId}]` : chatId ? '[чат]' : ''; const from = authorType === 'system' ? '[система]' : `@${resolvedAuthorSlug}`;