refactor: remove plan polling, add message-driven detection via usePlanDetection hook

This commit is contained in:
Bohdan Triapitsyn
2026-04-06 20:44:13 +03:00
parent a516650f96
commit 8de1884f5c
5 changed files with 111 additions and 124 deletions
@@ -38,6 +38,7 @@ import {
useSessionStatus,
} from '@/sync/sync-context';
import { useSync } from '@/sync/use-sync';
import { usePlanDetection } from '@/hooks/usePlanDetection';
import { getAllSyncSessions } from '@/sync/sync-refs';
const EMPTY_MESSAGES: Array<{ info: Message; parts: Part[] }> = [];
@@ -320,6 +321,9 @@ export const ChatContainer: React.FC = () => {
// Sessions from sync system
const sessions = useSessions();
// Plan detection - watches messages for plan creation and signals store
usePlanDetection(currentSessionId ?? '');
// Session status from sync system
const sessionStatusForCurrent = useSessionStatus(currentSessionId ?? '') ?? IDLE_SESSION_STATUS;