mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-29 19:35:20 +02:00
Adds 34 tests under tests/unit/tasks/chat/streaming/ that cover the new flows tree against the legacy stream_new_chat.py module to gate the upcoming cutover. Coverage: * Public entry points: stream_new_chat and stream_resume_chat are async generator functions whose parameter signatures (name, kind, annotation, default) match the legacy versions one-for-one. Uses a normalized-annotation comparison so PEP-563 vs eager-annotation representation differences are tolerated. * Extracted helpers: image-capability gate, runtime-context builders for new-chat and resume-chat, LLM-bundle dispatcher, premium-quota needs check + reservation dataclass, rate-limit recovery truth table, persistence-spawn registration/self-unregistration, await helpers. * SSE frame iterators: iter_initial_frames + iter_final_frames emit the canonical sequence; iter_token_usage_frame skips on None. * Initial thinking step: 4 parametrized branches (text, image-only, empty, mentioned-docs), long-query truncation, many-docs collapse. These tests are scaffolding for the cutover and will be removed once the legacy module is deleted. |
||
|---|---|---|
| .. | ||
| adapters | ||
| agents | ||
| connector_indexers | ||
| connectors | ||
| db | ||
| e2e_fakes | ||
| etl_pipeline | ||
| google_unification | ||
| indexing_pipeline | ||
| middleware | ||
| observability | ||
| routes | ||
| services | ||
| tasks | ||
| utils | ||
| __init__.py | ||
| test_error_contract.py | ||
| test_obsidian_plugin_indexer.py | ||
| test_stream_new_chat_contract.py | ||