Files
letta-server/letta
cthomas 2bccd36382 Revert "fix: ensure stop_reason is always set and reduce noisy logs (… (#9086)
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>
2026-01-29 12:44:04 -08:00
..
2025-10-07 17:50:45 -07:00
2025-10-07 17:50:45 -07:00
2026-01-12 10:57:48 -08:00
2025-09-17 15:47:40 -07:00
2025-09-17 15:47:40 -07:00
2025-09-17 15:47:40 -07:00
2025-09-17 15:47:40 -07:00
2025-09-17 15:47:40 -07:00
2026-01-19 15:57:32 -08:00
2025-10-07 17:50:45 -07:00
2025-09-17 15:47:40 -07:00
2025-09-17 15:47:40 -07:00
2025-10-07 17:50:49 -07:00
2025-09-17 15:47:40 -07:00
2025-09-17 15:47:40 -07:00
2025-09-17 15:47:40 -07:00