The streaming chat turn hangs in all browsers while the non-streaming test endpoint works — both use the same model/transport (createOpenAI + aiFetch), so the suspect is the streaming path / custom undici RetryAgent transport. - ai-http.ts: wrap aiFetch with per-request timing logs (start, ms-to-headers on success, elapsed ms + cause on failure). Chat at info, embeddings at debug. Only host+path logged. - ai-chat.controller.ts / ai-chat.service.ts: log turn START, first-chunk latency, FINISHED duration, and elapsed ms on disconnect/error/abort. - ai.service.ts: AI_BYPASS_RESILIENT_FETCH=true makes the CHAT model omit fetch:aiFetch and use the default global fetch — isolates transport vs request-shape. Chat-only; embeddings/STT untouched; reversible via env. - .env.example: document the flag. No timeout/retry change. tsc clean; ai-chat + ai suites pass (292).
6.7 KiB
6.7 KiB