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:
@@ -614,6 +614,8 @@ async fn chat_completions_stream(
|
|||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
yield Ok(Event::default().data("[DONE]"));
|
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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -869,6 +871,8 @@ async fn chat_completions_stream(
|
|||||||
Some(build_usage(pt, ct, crt, tt)),
|
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]"));
|
yield Ok(Event::default().data("[DONE]"));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user