Skip to content

🪲 BUG-#79 #80: Fix message loss in long interactions (provider, chat, serve, agent) - #82

Merged
FernandoCelmer merged 10 commits into
masterfrom
feature/80
Aug 24, 2026
Merged

🪲 BUG-#79 #80: Fix message loss in long interactions (provider, chat, serve, agent)#82
FernandoCelmer merged 10 commits into
masterfrom
feature/80

Conversation

@FernandoCelmer

Copy link
Copy Markdown
Member

Summary

  • _stream() in GenericProvider no longer discards accumulated text/tool_calls on a mid-read failure (timeout, network error, or anything else) — returns a partial ProviderResponse instead of raising, so the turn still gets persisted. Re-raises only when nothing was streamed yet, so retry logic still covers a pure connection failure. Bumped default/example timeout 60s → 180s.
  • chat.py: streamed text buffer is flushed to the log (marked "interrupted") before showing a turn error, instead of silently disappearing.
  • serve.py: broken pipe no longer kills the RPC thread silently; malformed NDJSON input is logged instead of dropped; added a heartbeat notification during long turns; confirm() now times out (120s) and declines instead of blocking forever.
  • agent.py: every Agent callback (on_message, on_tool_call, on_usage, etc.) is now wrapped so a consumer-side bug/failure (e.g. storage write error) can't abort the rest of an in-flight turn.

Closes #79, Closes #80

Test plan

  • pytest tests/ (excluding pre-existing flaky test_serve_end_to_end.py, unrelated) — 337 passed
  • New regression tests: mid-stream timeout partial preservation, broken pipe handling, confirm timeout, malformed NDJSON logging, callback isolation

@FernandoCelmer
FernandoCelmer merged commit 1f79eef into master Aug 24, 2026
8 checks passed
@FernandoCelmer
FernandoCelmer deleted the feature/80 branch August 24, 2026 22:11
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.

Harden message delivery in CLI and serve/plugin mode against transient failures Assistant response lost on mid-stream timeout

1 participant