mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-05 19:38:32 +02:00
fix: remove synthetic agent status fallback
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user