mirror of
https://github.com/andrewyng/openworker.git
synced 2026-09-11 06:30:25 +00:00
Keep interrupted partial streams in the transcript
GUI flushes the streaming buffer into a durable item on interrupted/error. Engine persists partial text on the provider-error path like the stop path. e2e red-green verified; full suites pass.
This commit is contained in:
@@ -244,6 +244,12 @@ class TurnEngine:
|
||||
if chunk.turn is not None:
|
||||
turn = chunk.turn
|
||||
except Exception as exc: # provider failure
|
||||
# Same contract as the stop path below: the partial text the user
|
||||
# watched arrive survives the failure (no tool calls — none finalized).
|
||||
if streamed:
|
||||
self.messages.append(
|
||||
_assistant_message(AssistantTurn(text="".join(streamed)))
|
||||
)
|
||||
friendly = friendly_model_error(self.model, exc)
|
||||
payload = {
|
||||
"error": friendly or str(exc),
|
||||
|
||||
Reference in New Issue
Block a user