Fix: ignore system messages and own messages in router
System messages (task lifecycle) were being forwarded to agent as new prompts, causing duplicate task creation. Agent also received its own chat.send broadcasts back and processed them.
This commit is contained in:
parent
6dcae9a320
commit
f8d9a6a41d
@ -79,6 +79,18 @@ export class EventRouter {
|
|||||||
return;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
// Build context-rich prompt for the agent
|
// Build context-rich prompt for the agent
|
||||||
const ctx = taskId ? `[задача ${taskKey || taskId}]` : chatId ? '[чат]' : '';
|
const ctx = taskId ? `[задача ${taskKey || taskId}]` : chatId ? '[чат]' : '';
|
||||||
const from = authorType === 'system' ? '[система]' : `@${resolvedAuthorSlug}`;
|
const from = authorType === 'system' ? '[система]' : `@${resolvedAuthorSlug}`;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user