fix(streaming): quota error detection, error persistence, stream_end session_id fix (#767)

- quota_exhausted error type: distinguishes credit exhaustion from rate limits
- Streaming errors persisted to session file so they survive page reload
- _error flag excludes persisted errors from subsequent LLM API calls
- stream_end and title SSE events use original session_id (not s.session_id which rotates during context compaction)

Fixes #739, #652, #653
This commit is contained in:
nesquena-hermes
2026-04-20 15:48:19 -07:00
committed by GitHub
parent 76e602af25
commit 765d8520d4
7 changed files with 278 additions and 70 deletions

View File

@@ -156,8 +156,10 @@ class TestIssue495TitleStreaming(unittest.TestCase):
)
def test_streaming_emits_title_sse_event(self):
# After the stream_end fix, title uses original session_id param (not s.session_id
# which can be rotated during context compression — see #652 fix)
self.assertIn(
"put_event('title', {'session_id': s.session_id, 'title': s.title})",
"put_event('title', {'session_id': session_id, 'title': s.title})",
STREAMING_PY,
"streaming.py should emit a title SSE event when title is updated",
)