Real-time responses with character-by-character streaming and idle timeout watchdog
ChatCLI supports real-time streaming of LLM responses, displaying text character-by-character as it is generated by the API. This significantly improves the user experience by eliminating the wait for complete responses.
chatcli server streams the same way: StreamPrompt forwards each fragment as the provider emits it (no post-hoc splitting of a buffered reply) and the final message carries the usage and stop reason. The remote client behind chatcli connect implements StreamingClient, so a connected CLI streams like a local one and its /cost prices the reported tokens. See server mode.
The Stream Watchdog monitors the stream to detect stalls (interruptions without data) and prevent ChatCLI from hanging indefinitely:
Timeouts
Result
Timer
Duration
Action
Warning
45 seconds
Logs a stall warning
Idle Timeout
90 seconds
Aborts stream and returns partial content
Both timers are reset on each received chunk. If the provider stops sending data for 90 seconds, the watchdog interrupts the stream and returns the accumulated text.
On slow networks or with providers that have high latency between chunks, increase the timeout to avoid premature interruptions. The default of 90 seconds is sufficient for most scenarios.