From e6a339d92ec57fdf75a4ec7624c57a987c7889d1 Mon Sep 17 00:00:00 2001 From: Nikketryhard Date: Mon, 16 Feb 2026 01:02:09 -0600 Subject: [PATCH] fix: clear request_in_flight when stream ends Without this, request_in_flight stayed true after tool call streaming, blocking all subsequent turns until the next completions handler happened to clear it first. --- src/api/completions.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/api/completions.rs b/src/api/completions.rs index 211ff65..bb61c65 100644 --- a/src/api/completions.rs +++ b/src/api/completions.rs @@ -614,6 +614,8 @@ async fn chat_completions_stream( ))); } yield Ok(Event::default().data("[DONE]")); + // Clear in-flight flag so the next turn's requests can get through + state.mitm_store.clear_response_async().await; return; } } @@ -869,6 +871,8 @@ async fn chat_completions_stream( Some(build_usage(pt, ct, crt, tt)), ))); } + // Always clear in-flight flag when stream ends + state.mitm_store.clear_response_async().await; yield Ok(Event::default().data("[DONE]")); };