diff --git a/runners/agent-runner/src/index.ts b/runners/agent-runner/src/index.ts index 427a4dd..c4b7787 100644 --- a/runners/agent-runner/src/index.ts +++ b/runners/agent-runner/src/index.ts @@ -555,14 +555,6 @@ 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) { - writeOutput({ - status: 'success', - phase: 'progress', - result: `📋 ${summary}`, - newSessionId, - }); - } if (description) { writeOutput({ status: 'success', @@ -574,8 +566,17 @@ async function runQuery( } if (message.type === 'system' && (message as { subtype?: string }).subtype === 'task_started') { - const ts = message as { task_id: string; teammate_name?: string }; - log(`Subagent started: task=${ts.task_id} name=${ts.teammate_name || 'unknown'}`); + const ts = message as { task_id: string; description?: string }; + const desc = ts.description || ''; + log(`Subagent started: task=${ts.task_id} desc=${desc.slice(0, 200)}`); + if (desc) { + writeOutput({ + status: 'success', + phase: 'progress', + result: `🔄 ${desc}`, + newSessionId, + }); + } } if (message.type === 'tool_progress') { diff --git a/src/message-turn-controller.ts b/src/message-turn-controller.ts index e6dddbc..5b715fb 100644 --- a/src/message-turn-controller.ts +++ b/src/message-turn-controller.ts @@ -133,6 +133,7 @@ export class MessageTurnController { if (text) { if (this.progressMessageId) { // Progress message already visible — update heading directly + this.previousProgressText = this.latestProgressText; this.latestProgressText = text; this.toolActivities = []; void this.syncTrackedProgressMessage(); @@ -153,6 +154,18 @@ export class MessageTurnController { // then discard the pending buffer so it never shows up. if (text) { await this.flushPendingProgress(text); + // If the displayed progress heading matches the final text, + // revert to the previous heading so it doesn't show twice. + if ( + this.latestProgressText === text && + this.previousProgressText && + this.progressMessageId && + this.options.channel.editMessage + ) { + this.latestProgressText = this.previousProgressText; + this.toolActivities = []; + await this.syncTrackedProgressMessage(); + } await this.finalizeProgressMessage(); await this.deliverFinalText(text); } else if (raw) { @@ -377,7 +390,11 @@ export class MessageTurnController { } this.progressTicker = setInterval(() => { - if (this.progressMessageId && this.latestProgressText && !this.progressCreating) { + if ( + this.progressMessageId && + this.latestProgressText && + !this.progressCreating + ) { void this.syncTrackedProgressMessage(); } }, 5_000);