refactor: reset message IDs on new turn and add activity log handlers

- Reset assistant message and thought IDs when starting new agent turn
- Add comprehensive activity log handlers in session context
- Handle tool calls, results, and errors with proper state updates
- Add transcription and assistant chunk streaming handlers
- Improve audio playback with proper error handling and confirmation
- Use generateMessageId() for consistent ID generation
- Filter out transcription activity logs from chat
- Stop audio playback when real speech is detected
```
This commit is contained in:
Mohamed Boudra
2025-10-23 12:22:42 +02:00
parent 41be2d4096
commit 91d691f31d
3 changed files with 202 additions and 38 deletions
@@ -20,6 +20,7 @@ import { theme as defaultTheme } from "@/styles/theme";
import { useRecentPaths } from "@/hooks/use-recent-paths";
import { useSession } from "@/contexts/session-context";
import { useRouter } from "expo-router";
import { generateMessageId } from "@/types/stream";
interface CreateAgentModalProps {
isVisible: boolean;
@@ -163,7 +164,7 @@ export function CreateAgentModal({
}
// Generate request ID
const requestId = crypto.randomUUID();
const requestId = generateMessageId();
setIsLoading(true);
setPendingRequestId(requestId);