fix: preserve manual agent selection during active runs (#678) (#679)

This commit is contained in:
Iuliia Ivashko
2026-03-17 02:47:30 +02:00
committed by GitHub
parent 3041f53e24
commit c4dc8b45cf
+11
View File
@@ -1462,6 +1462,17 @@ export const useEventStream = (options?: { enabled?: boolean }) => {
return true;
}
if (currentSessionIdRef.current === sessionId) {
const explicitSelection = useContextStore.getState().getSessionAgentSelection(sessionId);
if (explicitSelection && explicitSelection !== agentCandidate) {
const status = useSessionStore.getState().sessionStatus?.get(sessionId);
const isBusy = status?.type === 'busy' || status?.type === 'retry';
if (isBusy) {
return false;
}
}
}
const last = lastUserAgentSelectionRef.current.get(sessionId);
if (!last) return true;