mirror of
https://github.com/Youzini-afk/ST-Bionic-Memory-Ecology.git
synced 2026-05-15 22:30:38 +08:00
Root cause analysis: extraction can appear stuck at '正在提取xx-xx楼层' indefinitely when the LLM API connection goes half-open (server stops sending data but keeps the TCP connection alive). The SSE stream reader.read() would block forever with no per-chunk idle timeout. Changes: 1. llm/llm.js: Add LLM_STREAM_IDLE_TIMEOUT_MS (90s default) to parseDedicatedStreamingResponse. When no SSE data is received for 90 seconds, the read loop aborts with a clear timeout error instead of hanging forever. The idle timeout is configurable per-request (defaults to 30% of config timeout, minimum 30s). 2. index.js: Add EXTRACTION_VECTOR_SYNC_TIMEOUT_MS (120s) timeout wrapper around syncVectorState in handleExtractionSuccess. Vector sync now uses a combined AbortSignal (extraction signal + timeout) so that either user abort or 120s timeout will break out. Vector sync timeout is treated as non-fatal (doesn't abort the entire extraction batch).