mirror of
https://github.com/openai/codex.git
synced 2026-11-23 07:17:11 +00:00
turn metadata: per-turn non-blocking (#11677)
This commit is contained in:
1 parent
a4bb59884b
commit
6c0a924203
11 files changed
+457
-158
No files matched your search
@@ -10,7 +10,6 @@ use async_trait::async_trait;
|
||||
use codex_otel::OtelManager;
|
||||
use codex_protocol::openai_models::ModelInfo;
|
||||
use codex_protocol::user_input::UserInput;
|
||||
use futures::future::BoxFuture;
|
||||
use tokio::task::JoinHandle;
|
||||
use tokio_util::sync::CancellationToken;
|
||||
use tracing::Instrument;
|
||||
@@ -39,13 +38,11 @@ impl RegularTask {
|
||||
model_client: ModelClient,
|
||||
otel_manager: OtelManager,
|
||||
model_info: ModelInfo,
|
||||
turn_metadata_header: BoxFuture<'static, Option<String>>,
|
||||
) -> Self {
|
||||
let prewarmed_session_task = tokio::spawn(async move {
|
||||
let mut client_session = model_client.new_session();
|
||||
let turn_metadata_header = turn_metadata_header.await;
|
||||
match client_session
|
||||
.prewarm_websocket(&otel_manager, &model_info, turn_metadata_header.as_deref())
|
||||
.prewarm_websocket(&otel_manager, &model_info)
|
||||
.await
|
||||
{
|
||||
Ok(()) => Some(client_session),
|
||||
|
||||
Reference in new issue
Block a user