diff --git a/BACKEND_UI_CHANGES.md b/BACKEND_UI_CHANGES.md index c53450d..1d0eea2 100644 --- a/BACKEND_UI_CHANGES.md +++ b/BACKEND_UI_CHANGES.md @@ -87,7 +87,7 @@ The Electron main process maps this to a `SessionEventRecord` with `kind: 'agent - "Code Reviewer is using read_file…" - "Handing off to Summarizer…" -The activity panel in `ChatPane.tsx` is now wired to this data, showing every agent in the pattern with a current status such as waiting, thinking, tool usage, handoff, or completed. +The activity panel in `ChatPane.tsx` is now wired to this data, showing every agent in the pattern with observed activity such as thinking, tool usage, handoff, or completed. If no event has been observed for an agent yet, the UI now states that no status has been reported instead of inventing a synthetic state. ## Files involved diff --git a/src/renderer/components/ChatPane.tsx b/src/renderer/components/ChatPane.tsx index 4abc997..c3cd43a 100644 --- a/src/renderer/components/ChatPane.tsx +++ b/src/renderer/components/ChatPane.tsx @@ -37,8 +37,8 @@ export function ChatPane({ activity, project, pattern, session, onSend }: ChatPa const isBusy = session.status === 'running'; const activityRows = useMemo( - () => buildAgentActivityRows(activity, pattern.agents, isBusy), - [activity, isBusy, pattern.agents], + () => buildAgentActivityRows(activity, pattern.agents), + [activity, pattern.agents], ); useEffect(() => { diff --git a/src/renderer/lib/sessionActivity.ts b/src/renderer/lib/sessionActivity.ts index 9b856cf..fda3020 100644 --- a/src/renderer/lib/sessionActivity.ts +++ b/src/renderer/lib/sessionActivity.ts @@ -77,11 +77,8 @@ export function pruneSessionActivities( export function buildAgentActivityRows( current: SessionActivityState | undefined, agents: PatternDefinition['agents'], - isBusy: boolean, ): AgentActivityRow[] { - const hasReportedActivity = !!current && Object.keys(current).length > 0; - - return agents.map((agent, index) => { + return agents.map((agent) => { const activity = current?.[agent.id] ?? current?.[agent.name]; if (activity) { @@ -92,18 +89,6 @@ export function buildAgentActivityRows( }; } - if (!hasReportedActivity && isBusy && index === 0) { - return { - key: agent.id, - agentName: agent.name, - activity: { - agentId: agent.id, - agentName: agent.name, - activityType: 'thinking', - }, - }; - } - return { key: agent.id, agentName: agent.name, @@ -113,7 +98,7 @@ export function buildAgentActivityRows( export function formatAgentActivityLabel(activity: AgentActivityState | undefined): string { if (!activity) { - return 'Waiting…'; + return 'No status yet'; } switch (activity?.activityType) { @@ -126,7 +111,7 @@ export function formatAgentActivityLabel(activity: AgentActivityState | undefine case 'thinking': return 'Thinking…'; default: - return 'Waiting…'; + return 'No status yet'; } } diff --git a/tests/renderer/sessionActivity.test.ts b/tests/renderer/sessionActivity.test.ts index 84479d9..c860e0e 100644 --- a/tests/renderer/sessionActivity.test.ts +++ b/tests/renderer/sessionActivity.test.ts @@ -125,15 +125,10 @@ describe('session activity helpers', () => { }); test('builds rows for all agents with sensible defaults', () => { - expect(buildAgentActivityRows(undefined, agents, true)).toEqual([ + expect(buildAgentActivityRows(undefined, agents)).toEqual([ { key: 'architect', agentName: 'Architect', - activity: { - agentId: 'architect', - agentName: 'Architect', - activityType: 'thinking', - }, }, { key: 'reviewer', @@ -157,7 +152,6 @@ describe('session activity helpers', () => { }, }, agents, - true, ), ).toEqual([ { @@ -183,7 +177,7 @@ describe('session activity helpers', () => { }); test('formats contextual activity labels and state flags', () => { - expect(formatAgentActivityLabel(undefined)).toBe('Waiting…'); + expect(formatAgentActivityLabel(undefined)).toBe('No status yet'); expect( formatAgentActivityLabel({ agentId: 'reviewer',