From 8d08a1df1a8bfb05815d785ed7d08d2a98a4b172 Mon Sep 17 00:00:00 2001 From: David Kaya Date: Mon, 13 Apr 2026 16:20:04 +0200 Subject: [PATCH] refactor: wire normalized intent into activity UI - ChatPane header now prefers session.currentIntent over the activity- derived label from summarizeSessionActivity for the busy status display - TurnActivityPanel receives currentIntent via props and prefers it over extractLatestIntent (report_intent tool-call scanning) when the panel is active; falls back to tool-call scan for completed/inactive runs - This replaces the report_intent-as-status inference pattern with the normalized assistant-intent event data from the backend Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/renderer/components/ChatPane.tsx | 3 ++- src/renderer/components/chat/TurnActivityPanel.tsx | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/renderer/components/ChatPane.tsx b/src/renderer/components/ChatPane.tsx index 73bb69b..728a5ce 100644 --- a/src/renderer/components/ChatPane.tsx +++ b/src/renderer/components/ChatPane.tsx @@ -530,7 +530,7 @@ export function ChatPane({ )} {isSessionBusy && !pendingApproval && !pendingUserInput && (() => { - const label = summarizeSessionActivity(sessionActivity); + const label = session.currentIntent ?? summarizeSessionActivity(sessionActivity); return (
@@ -593,6 +593,7 @@ export function ChatPane({ isActive={isTurnActive(item, itemIndex)} turnStartedAt={item.turnStartedAt} sessionId={session.id} + currentIntent={session.currentIntent} agentNames={item.agentNames} isLastRunPanel={item.isLastRunPanel} onDiscard={onDiscardRunChanges} diff --git a/src/renderer/components/chat/TurnActivityPanel.tsx b/src/renderer/components/chat/TurnActivityPanel.tsx index 0e7a278..11d4ce7 100644 --- a/src/renderer/components/chat/TurnActivityPanel.tsx +++ b/src/renderer/components/chat/TurnActivityPanel.tsx @@ -41,6 +41,7 @@ export interface TurnActivityPanelProps { isActive: boolean; turnStartedAt?: string; sessionId: string; + currentIntent?: string; agentNames?: ReadonlySet; isLastRunPanel?: boolean; onDiscard?: (sessionId: string, runId: string, files?: ProjectGitFileReference[]) => Promise; @@ -418,6 +419,7 @@ export function TurnActivityPanel({ isActive, turnStartedAt, sessionId, + currentIntent, agentNames, isLastRunPanel, onDiscard, @@ -471,8 +473,12 @@ export function TurnActivityPanel({ return groupActivityStream(stream); }, [thinkingMessages, scopedEvents]); - // Extract intent text for the header - const intentText = useMemo(() => extractLatestIntent(scopedEvents), [scopedEvents]); + // Prefer the session-level normalized intent when active; fall back to + // scanning run timeline for report_intent tool calls (backward compat). + const intentText = useMemo( + () => (isActive ? currentIntent : undefined) ?? extractLatestIntent(scopedEvents), + [isActive, currentIntent, scopedEvents], + ); const fallbackSummary = useMemo( () => !intentText ? generateActivitySummary(scopedEvents) : undefined, [intentText, scopedEvents],