mirror of
https://github.com/openai/codex.git
synced 2026-02-01 22:47:52 +00:00
Rename cancel_request_user_input helper
This commit is contained in:
@@ -933,6 +933,7 @@ impl Session {
|
||||
});
|
||||
|
||||
// Dispatch the SessionConfiguredEvent first and then report any errors.
|
||||
// If resuming, include converted initial messages in the payload so UIs can render them immediately.
|
||||
let initial_messages = initial_history.get_event_msgs();
|
||||
let events = std::iter::once(Event {
|
||||
id: INITIAL_SUBMIT_ID.to_owned(),
|
||||
@@ -1710,7 +1711,7 @@ impl Session {
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn cancel_pending_user_input(&self, sub_id: &str) {
|
||||
pub async fn cancel_request_user_input(&self, sub_id: &str) {
|
||||
let _ = {
|
||||
let mut active = self.active_turn.lock().await;
|
||||
match active.as_mut() {
|
||||
@@ -4191,6 +4192,7 @@ async fn handle_assistant_item_done_in_plan_mode(
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
async fn drain_in_flight(
|
||||
in_flight: &mut FuturesOrdered<BoxFuture<'static, CodexResult<ResponseInputItem>>>,
|
||||
sess: Arc<Session>,
|
||||
|
||||
@@ -405,7 +405,7 @@ where
|
||||
let empty = RequestUserInputResponse {
|
||||
answers: HashMap::new(),
|
||||
};
|
||||
parent_session.cancel_pending_user_input(sub_id).await;
|
||||
parent_session.cancel_request_user_input(sub_id).await;
|
||||
empty
|
||||
}
|
||||
response = fut => response.unwrap_or_else(|| RequestUserInputResponse {
|
||||
@@ -527,7 +527,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn cancel_pending_user_input_clears_session_buffer() {
|
||||
async fn cancel_request_user_input_clears_session_buffer() {
|
||||
let (session, ctx, _rx_evt) = crate::codex::make_session_and_context_with_rx().await;
|
||||
|
||||
let (tx, rx) = oneshot::channel();
|
||||
@@ -542,7 +542,7 @@ mod tests {
|
||||
*active = Some(turn);
|
||||
}
|
||||
|
||||
session.cancel_pending_user_input(&ctx.sub_id).await;
|
||||
session.cancel_request_user_input(&ctx.sub_id).await;
|
||||
|
||||
assert!(rx.await.is_err(), "sender should be dropped on cancel");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user