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.
This commit is contained in:
Nikketryhard
2026-02-16 01:02:09 -06:00
parent 3fdd0368a0
commit e6a339d92e

View File

@@ -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]"));
};