Skip to content

🪲 BUG-#79: Preserve partial stream text on mid-response timeout - #81

Closed
FernandoCelmer wants to merge 3 commits into
masterfrom
feature/79
Closed

🪲 BUG-#79: Preserve partial stream text on mid-response timeout#81
FernandoCelmer wants to merge 3 commits into
masterfrom
feature/79

Conversation

@FernandoCelmer

Copy link
Copy Markdown
Member

Summary

  • _stream() in GenericProvider no longer discards accumulated text/tool_calls when the socket times out mid-read — returns a partial ProviderResponse with stop_reason="connection_lost" instead, so the turn still gets persisted via session.add_assistant().
  • Re-raises when nothing was streamed yet, so Agent._complete()'s existing retry logic still applies to a pure connection failure.
  • Bumped the default/example provider timeout from 60s to 180s — too short for models with long reasoning.

Closes #79

Test plan

  • pytest tests/providers/test_generic.py — 31 passed, including new regression tests for mid-stream timeout (partial preserved) and pure-timeout-with-nothing-streamed (still raises)
  • pytest tests/ (excluding pre-existing flaky test_serve_end_to_end.py) — 326 passed

@FernandoCelmer

Copy link
Copy Markdown
Member Author

Closing — consolidating into a single PR for #79 and #80 together.

@FernandoCelmer
FernandoCelmer deleted the feature/79 branch August 25, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Assistant response lost on mid-stream timeout

1 participant