Swiss AI Hub v0.292.3
Pre-release
Pre-release
Fixed
- 🐛 Resolved a race condition that could cause agent output streaming chunks to be dropped, leading to incomplete or
blank answers in chat clients. This fix ensures allDisplayEvents are processed before consumer teardown. - 🔗 Guaranteed the delivery of complete agent answers by implementing a durable backstop that reconciles any missing
content from the final stop event, preventing empty assistant turns and associated errors.
Added
- ✨ Introduced shared utility methods,
iter_streamed_display_eventsandwait_for_stop_then_drain, in
ChatServiceto ensure all display events are gracefully drained and processed after an agent run completes. - 📄 Documented the architectural decision for robust streaming in a new ADR: "Drain Display-Event Streams Before
Consumer Teardown". - 🧪 Added new unit tests to validate the correctness and resilience of the event draining and answer reconciliation
logic.
Changed
- 🔄 Refactored all streaming event consumers (including OpenAI SSE, JSON, and native event streams) to utilize the
new graceful draining mechanisms, improving the consistency and reliability of agent output. - 🚀 Updated final content resolution for OpenAI and JSON responses to include delta reconciliation, using the
terminalStopEventas a source of truth to complete partially streamed or lost answers.