refactor(chat): tách nốt phần nối lại lượt đang chạy — chat_session_store 414 -> 352

chat_live_turns.py (90 dòng) là phần tinh tế nhất của khung chat: người dùng
mở phiên khác rồi quay lại trong khi lượt cũ vẫn đang chạy. Phải nối vào đúng
luồng đó và đúng danh sách tin nhắn đang sống, chứ không đọc bản trên đĩa (đã
cũ) hay khởi động lại. Sai thì hoặc mất phần agent viết lúc mình vắng mặt,
hoặc hai bên cùng ghi vào một file.

Giờ Gamma không còn file production nào vượt 400 dòng.

756 test xanh.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Nam Pham Dinh Thanh
2026-08-28 01:11:22 +09:00
co-authored by Claude Opus 5
parent 577b81a641
commit fdaedfa1c2
3 changed files with 92 additions and 63 deletions
+2 -1
View File
@@ -13,6 +13,7 @@ from __future__ import annotations
from ..presentation.chat.chat_event_stream import ChatEventStreamMixin
from ..presentation.chat.chat_panel_layout import ChatPanelLayoutMixin
from ..presentation.chat.chat_live_turns import ChatLiveTurnsMixin
from ..presentation.chat.chat_helpers import ( # noqa: F401 — giữ đường vào cũ
_TOOL_STATUS, _format_plan_steps, _is_scratch,
)
@@ -55,7 +56,7 @@ _PLAN_ICONS = {"pending": "○", "running": "▶", "done": "✓", "error": "✗"
class ChatPanel(ChatPanelLayoutMixin, ChatEventStreamMixin, AttachmentMixin,
class ChatPanel(ChatLiveTurnsMixin, ChatPanelLayoutMixin, ChatEventStreamMixin, AttachmentMixin,
OutputPanelMixin,
ChatAgentsMixin,
ChatTurnRunnerMixin,