abort orphaned stream tasks on drop, reduce timeout to 60s

Spawned streaming tasks were never cancelled when a turn ended or
retried, leaving zombie tasks blocked on dead vLLM connections.
AbortOnDrop wrapper aborts the task when it goes out of scope.

Chunk timeout reduced from 120s to 60s.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-02 18:41:02 -04:00
parent 0148dbaa06
commit 13d9cc962e
2 changed files with 15 additions and 6 deletions

View file

@ -246,7 +246,7 @@ impl Agent {
// Stream events from the API — we route each event to the
// appropriate UI pane rather than letting the API layer do it.
let api_messages = self.assemble_api_messages();
let mut rx = self.client.start_stream(
let (mut rx, _stream_guard) = self.client.start_stream(
&api_messages,
Some(&self.tool_defs),
ui_tx,