SurfSense/surfsense_backend/app/tasks/chat/streaming/flows/shared
CREDO23 21bddc73a7 refactor(chat): add streaming/flows/shared/assistant_finalize.py
Extracts finalize_assistant_message: the post-stream server-side write
of the final assistant message (with content parts + token usage)
guarded by asyncio.shield + shielded_async_session so a client
disconnect cannot abort the persist.

Add-only; legacy stream_new_chat.py keeps its inline finalize block
until cutover.
2026-05-25 21:49:31 +02:00
..
__init__.py refactor(chat): add streaming/flows/shared/ base helpers 2026-05-25 21:49:09 +02:00
assistant_finalize.py refactor(chat): add streaming/flows/shared/assistant_finalize.py 2026-05-25 21:49:31 +02:00
finalize_emit.py refactor(chat): add streaming/flows/shared/ base helpers 2026-05-25 21:49:09 +02:00
finally_cleanup.py refactor(chat): add streaming/flows/shared/ base helpers 2026-05-25 21:49:09 +02:00
first_frames.py refactor(chat): add streaming/flows/shared/ base helpers 2026-05-25 21:49:09 +02:00
llm_bundle.py refactor(chat): add streaming/flows/shared/ base helpers 2026-05-25 21:49:09 +02:00
pre_stream_setup.py refactor(chat): add streaming/flows/shared/ base helpers 2026-05-25 21:49:09 +02:00
premium_quota.py refactor(chat): add streaming/flows/shared/premium_quota.py 2026-05-25 21:49:14 +02:00
rate_limit_recovery.py refactor(chat): add streaming/flows/shared/ rate-limit recovery + stream loop 2026-05-25 21:49:27 +02:00
span.py refactor(chat): add streaming/flows/shared/ base helpers 2026-05-25 21:49:09 +02:00
stream_loop.py refactor(chat): add streaming/flows/shared/ rate-limit recovery + stream loop 2026-05-25 21:49:27 +02:00
terminal_error.py refactor(chat): add streaming/flows/shared/terminal_error.py 2026-05-25 21:49:18 +02:00