Revert "fix: ensure stop_reason is always set and reduce noisy logs (#9046)" This reverts commit 4241a360579440d2697124ba69061d0e46ecc5e9. **Problem:** After the original change, caren-code-agent reported streams hanging indefinitely. The trace shows ttft (time to first token) succeeds, but the stream never closes. **Root Cause (suspected):** The change modified `is_complete=is_done` to `is_complete=saw_done`, meaning error events no longer mark the stream as complete immediately. This may cause timing issues where clients wait for more data before the finalizer runs. **Fix:** Revert to the defensive "belt-and-suspenders" approach that always appends [DONE]. The noisy logs are preferable to hanging streams. The original comment noted: "Even if a previous chunk set `complete`, an extra [DONE] is harmless and ensures SDKs that rely on explicit [DONE] will exit." 👾 Generated with [Letta Code](https://letta.com) Co-authored-by: Letta <noreply@letta.com>
19 KiB
19 KiB