From f0a6db646152938164458e4e463ae243a253379a Mon Sep 17 00:00:00 2001 From: iliya Date: Sat, 14 Mar 2026 13:56:18 +0200 Subject: [PATCH] refactor: adjust detection priority for teammate identification - Updated the detection priority logic for teammate identification to ensure that the teammate ID is recognized as a message sender rather than the file owner. - Changed the priority threshold from 3 to 2 to allow for more accurate routing of messages based on sender identification. --- src/main/services/team/TeamMemberLogsFinder.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/services/team/TeamMemberLogsFinder.ts b/src/main/services/team/TeamMemberLogsFinder.ts index e84a0aac..3a8d8e87 100644 --- a/src/main/services/team/TeamMemberLogsFinder.ts +++ b/src/main/services/team/TeamMemberLogsFinder.ts @@ -1000,12 +1000,13 @@ export class TeamMemberLogsFinder { parsed[0]?.summary || parsed[0]?.content?.slice(0, 200) || 'Teammate spawn'; } - // teammate_id is a structured XML attribute — highest reliability signal - if (detectionPriority < 3 && parsed[0]?.teammateId) { + // teammate_id identifies the MESSAGE SENDER (e.g. "team-lead"), not the agent + // owning this file. Use priority 2 so routing.sender (priority 3) can override. + if (detectionPriority < 2 && parsed[0]?.teammateId) { const tmId = parsed[0].teammateId.trim().toLowerCase(); if (tmId.length > 0 && knownMembers.has(tmId)) { detectedMember = parsed[0].teammateId.trim(); - detectionPriority = 3; + detectionPriority = 2; } } } else if (!description) {