mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #328] server: KeyError 'tail' in OpenAI API streaming handler with multiple sessions #159
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#159
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jinkang06 on GitHub (Oct 1, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/328
KeyError: 'tail'
Exception occurred during processing of request
Traceback (most recent call last):
File ".../server.py", line ...
self._note(n, evs)
File ".../server.py", line 958, in _note
s["tail"] = (s["tail"] + (ev.text or ""))[-600:]
KeyError: 'tail'
before
_note()appends streaming text.Proposed fix
Change:
to:
or initialize
tailwhen creating the session state:This should preserve existing behavior while avoiding failures when a new streaming state does not yet contain
tail.Additional notes
The model engine and conversation cache continue working after this exception. The issue appears limited to the HTTP server bookkeeping path.
I can provide full logs if needed.
@Niko1221 commented on GitHub (Oct 1, 2026):
Fixed in 0.1.31 (#266): a request's status is recorded while it still holds the queue. Please update; reopen if it happens on 0.1.31.