feat: Add LangGraph streaming with real-time UI updates

- Add streaming schemas and events
- Implement run_review_stream in ReviewerAgent
- Update task_worker to broadcast streaming events via WebSocket
- Create ReviewStream component for real-time progress visualization
- Integrate ReviewStream into ReviewDetail page
- Show agent steps, LLM messages, and progress in real-time
This commit is contained in:
Primakov Alexandr Alexandrovich
2025-10-13 01:00:49 +03:00
parent 2ad11142ad
commit 4ab6400a87
6 changed files with 383 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ import { getReview, retryReview } from '../api/client';
import { wsClient } from '../api/websocket';
import ReviewProgress from '../components/ReviewProgress';
import CommentsList from '../components/CommentsList';
import { ReviewStream } from '../components/ReviewStream';
import { formatDistance } from 'date-fns';
import { ru } from 'date-fns/locale';
@@ -127,6 +128,11 @@ export default function ReviewDetail() {
</div>
</div>
{/* Real-time Review Stream (only during review) */}
{['pending', 'fetching', 'analyzing', 'commenting'].includes(review.status) && (
<ReviewStream reviewId={review.id} />
)}
{/* Progress */}
<div className="bg-gray-800 rounded-lg p-6 border border-gray-700">
<h2 className="text-xl font-semibold text-white mb-4">Прогресс</h2>