первый коммит

This commit is contained in:
2026-02-27 21:28:09 +03:00
parent 1e376aff24
commit e8805ffe29
171 changed files with 6400 additions and 556 deletions

View File

@@ -14,6 +14,13 @@ from app.modules.shared.retry_executor import RetryExecutor
LOGGER = logging.getLogger(__name__)
def _truncate_for_log(text: str, max_chars: int = 1200) -> str:
value = (text or "").replace("\n", "\\n").strip()
if len(value) <= max_chars:
return value
return value[:max_chars].rstrip() + "...[truncated]"
class ChatOrchestrator:
def __init__(
self,
@@ -78,6 +85,16 @@ class ChatOrchestrator:
try:
await self._publish_progress(task_id, "task.sessions", "Проверяю сессии диалога и проекта.", progress=10)
dialog_session_id, rag_session_id = self._resolve_sessions(request)
LOGGER.warning(
"incoming chat request: task_id=%s dialog_session_id=%s rag_session_id=%s mode=%s attachments=%s files=%s message=%s",
task_id,
dialog_session_id,
rag_session_id,
request.mode.value,
len(request.attachments),
len(request.files),
_truncate_for_log(request.message),
)
await self._publish_progress(task_id, "task.sessions.done", "Сессии проверены, запускаю агента.", progress=15)
loop = asyncio.get_running_loop()