diff --git a/runners/agent-runner/src/index.ts b/runners/agent-runner/src/index.ts index 8df9b46..09c23b9 100644 --- a/runners/agent-runner/src/index.ts +++ b/runners/agent-runner/src/index.ts @@ -555,20 +555,12 @@ async function runQuery( const tp = message as Record; const summary = typeof tp.summary === 'string' ? tp.summary : ''; const description = typeof tp.description === 'string' ? tp.description : ''; - if (summary) { - log(`Subagent progress: ${summary.slice(0, 200)}`); - writeOutput({ - status: 'success', - phase: 'progress', - result: summary, - newSessionId, - }); - } - if (description) { + const activityText = description || summary; + if (activityText) { writeOutput({ status: 'success', phase: 'tool-activity', - result: description, + result: activityText, newSessionId, }); } diff --git a/src/message-runtime-rules.ts b/src/message-runtime-rules.ts index 1b04f29..da9145e 100644 --- a/src/message-runtime-rules.ts +++ b/src/message-runtime-rules.ts @@ -44,7 +44,9 @@ export function createImplicitContinuationTracker(idleTimeout: number) { implicitContinuationUntil.delete(chatJid); return false; } - return messages.some((message) => message.is_from_me !== true); + return messages.some( + (message) => message.is_from_me !== true && !message.is_bot_message, + ); }, }; } diff --git a/src/message-turn-controller.ts b/src/message-turn-controller.ts index 1303c62..eccd978 100644 --- a/src/message-turn-controller.ts +++ b/src/message-turn-controller.ts @@ -228,11 +228,16 @@ export class MessageTurnController { if (minutes > 0) elapsedParts.push(`${minutes}분`); elapsedParts.push(`${seconds}초`); - const activityLines = this.toolActivities.length > 0 - ? '\n' + this.toolActivities.map((a) => `├ ${a}`).join('\n') - : ''; + const activityLines = + this.toolActivities.length > 0 + ? '\n' + this.toolActivities.map((a) => `├ ${a}`).join('\n') + : ''; const suffix = `\n\n${elapsedParts.join(' ')}`; - const maxText = 2000 - TASK_STATUS_MESSAGE_PREFIX.length - activityLines.length - suffix.length; + const maxText = + 2000 - + TASK_STATUS_MESSAGE_PREFIX.length - + activityLines.length - + suffix.length; const truncated = text.length > maxText ? text.slice(0, maxText - 1) + '…' : text; return `${TASK_STATUS_MESSAGE_PREFIX}${truncated}${activityLines}${suffix}`; @@ -265,16 +270,16 @@ export class MessageTurnController { private bufferProgress(text: string): void { if (this.pendingProgressText) { void this.sendProgressMessage(this.pendingProgressText); + this.toolActivities = []; } this.pendingProgressText = text; - this.toolActivities = []; } /** * Append a tool activity line and update the progress message in-place. */ private addToolActivity(description: string): void { - const MAX_ACTIVITIES = 5; + const MAX_ACTIVITIES = 2; this.toolActivities.push(description); if (this.toolActivities.length > MAX_ACTIVITIES) { this.toolActivities = this.toolActivities.slice(-MAX_ACTIVITIES);