Stop the streamer without sending on closed queues (closes #34) #36

Merged
clawbot merged 1 commits from issue-34-stop-panic into next 2026-09-28 21:42:34 +02:00
1 Commits
Author SHA1 Message Date
clawbot 2c32eaa4de Stop the streamer without sending on closed queues (closes #34)
check / check (push) Successful in 2m40s
Stop cancels the stream and closes the handler queues under the streamer's write lock, but the read loop only checked for a stop before parsing each line. A stop landing after that check made the loop send the message to a closed queue and panic. The loop now checks again under the read lock it already takes before handing the message to the queues, and returns if the stream was stopped.

Stop also clears its cancel function and returns early when there is none, so a second call no longer closes the queues again, as its comment already promised.

The new test calls Stop from the raw handler, which runs in exactly that gap, and then calls Stop a second time.

Model: opus-5-5
2026-09-28 19:13:08 +00:00