From 8a7f75eeef943520a7f3cb67f7381ed80364d0d8 Mon Sep 17 00:00:00 2001 From: jimmyfraiture Date: Mon, 29 Sep 2025 13:08:17 +0100 Subject: [PATCH] Just fix --- codex-rs/agent/src/rollout/list.rs | 3 ++- codex-rs/core/src/codex.rs | 12 ++++-------- codex-rs/mcp-server/tests/suite/user_info.rs | 9 ++++++--- codex-rs/tui/src/lib.rs | 6 ++++-- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/codex-rs/agent/src/rollout/list.rs b/codex-rs/agent/src/rollout/list.rs index cf4ab157a7..10c521b561 100644 --- a/codex-rs/agent/src/rollout/list.rs +++ b/codex-rs/agent/src/rollout/list.rs @@ -111,7 +111,8 @@ pub async fn find_conversation_path_by_id_str( } let limit = NonZero::new(1).ok_or_else(|| io::Error::other("search limit must be non-zero"))?; - let threads = NonZero::new(2).ok_or_else(|| io::Error::other("thread pool size must be non-zero"))?; + let threads = + NonZero::new(2).ok_or_else(|| io::Error::other("thread pool size must be non-zero"))?; let cancel = Arc::new(AtomicBool::new(false)); let exclude: Vec = Vec::new(); let compute_indices = false; diff --git a/codex-rs/core/src/codex.rs b/codex-rs/core/src/codex.rs index 6b18ad1bec..188c30a373 100644 --- a/codex-rs/core/src/codex.rs +++ b/codex-rs/core/src/codex.rs @@ -560,13 +560,6 @@ impl Session { startup_errors, .. } = bootstrap; - let post_session_configured_error_events: Vec = startup_errors - .into_iter() - .map(|message| Event { - id: INITIAL_SUBMIT_ID.to_owned(), - msg: EventMsg::Error(ErrorEvent { message }), - }) - .collect(); // Create the mutable state for the Session. let state = SessionState::new(); @@ -599,7 +592,10 @@ impl Session { rollout_path, }), }) - .chain(post_session_configured_error_events.into_iter()); + .chain(startup_errors.into_iter().map(|message| Event { + id: INITIAL_SUBMIT_ID.to_owned(), + msg: EventMsg::Error(ErrorEvent { message }), + })); for event in events { sess.send_event(event).await; } diff --git a/codex-rs/mcp-server/tests/suite/user_info.rs b/codex-rs/mcp-server/tests/suite/user_info.rs index 7bcb2acc6b..08fc07b7b1 100644 --- a/codex-rs/mcp-server/tests/suite/user_info.rs +++ b/codex-rs/mcp-server/tests/suite/user_info.rs @@ -25,9 +25,12 @@ async fn user_info_returns_email_from_auth_json() { let codex_home = TempDir::new().expect("create tempdir"); let auth_path = get_auth_file(codex_home.path()); - let mut id_token = IdTokenInfo::default(); - id_token.email = Some("user@example.com".to_string()); - id_token.raw_jwt = encode_id_token_with_email("user@example.com").expect("encode id token"); + let raw_jwt = encode_id_token_with_email("user@example.com").expect("encode id token"); + let id_token = IdTokenInfo { + email: Some("user@example.com".to_string()), + raw_jwt, + ..IdTokenInfo::default() + }; let auth = AuthDotJson { openai_api_key: None, diff --git a/codex-rs/tui/src/lib.rs b/codex-rs/tui/src/lib.rs index 1453971ca4..7d5101f090 100644 --- a/codex-rs/tui/src/lib.rs +++ b/codex-rs/tui/src/lib.rs @@ -590,8 +590,10 @@ mod tests { AuthMode::ChatGPT => { // Minimal valid JWT payload: header.payload.signature (all base64url, no padding) const FAKE_JWT: &str = "eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.e30.c2ln"; // {"alg":"none","typ":"JWT"}.{}."sig" - let mut id_info = IdTokenInfo::default(); - id_info.raw_jwt = FAKE_JWT.to_string(); + let id_info = IdTokenInfo { + raw_jwt: FAKE_JWT.to_string(), + ..IdTokenInfo::default() + }; let auth = AuthDotJson { openai_api_key: None, tokens: Some(TokenData {