mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-10 05:38:45 +02:00
fix: detect Quick Prompt completion from all terminal events
The popup stayed in 'streaming' phase because it only transitioned to 'complete' on message-complete or status:idle when prev was exactly 'streaming'. If other events (agent-activity, run-updated) arrived between the last delta and idle, the phase guard could miss. Broaden completion detection: - status:idle now completes from any non-idle/non-complete phase - agent-activity:completed also triggers completion - Covers all paths the sidecar uses to signal turn end Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -80,7 +80,9 @@ export function QuickPromptApp() {
|
|||||||
} else if (event.kind === 'message-complete') {
|
} else if (event.kind === 'message-complete') {
|
||||||
setPhase('complete');
|
setPhase('complete');
|
||||||
} else if (event.kind === 'status' && event.status === 'idle') {
|
} else if (event.kind === 'status' && event.status === 'idle') {
|
||||||
setPhase((prev) => (prev === 'streaming' ? 'complete' : prev));
|
setPhase((prev) => (prev === 'idle' || prev === 'complete' ? prev : 'complete'));
|
||||||
|
} else if (event.kind === 'agent-activity' && event.activityType === 'completed') {
|
||||||
|
setPhase((prev) => (prev === 'idle' || prev === 'complete' ? prev : 'complete'));
|
||||||
} else if (event.kind === 'error') {
|
} else if (event.kind === 'error') {
|
||||||
setErrorMessage(event.error ?? 'An unexpected error occurred.');
|
setErrorMessage(event.error ?? 'An unexpected error occurred.');
|
||||||
setPhase('error');
|
setPhase('error');
|
||||||
|
|||||||
Reference in New Issue
Block a user