mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-07-31 09:46:05 -04:00
fix(agent): reset stream_active at turn start
`stream_active` relied on every runTools exit path balancing pause with `endStreamedText`. If one is ever missed, a stale-true flag skips the spinner pause on the next turn, interleaving frames with streamed text. Reset it alongside `streamed_text` so the invariant is local.
This commit is contained in:
@@ -1663,6 +1663,10 @@ fn processUserMessage(self: *Agent, input: TurnInput) !?[]const u8 {
|
||||
const ma = self.conversation.arena.allocator();
|
||||
self.api_error_detail = null;
|
||||
self.streamed_text = false;
|
||||
// Defensive: if an exit path ever missed `endStreamedText`, a stale-true
|
||||
// `stream_active` would skip the spinner pause on the next turn's first
|
||||
// delta and let frames interleave with the text. Reset it at the source.
|
||||
self.stream_active = false;
|
||||
self.http_interrupt.reset();
|
||||
|
||||
try self.conversation.ensureSystemPrompt();
|
||||
|
||||
Reference in New Issue
Block a user