From a70ec9b26e2dc8ca2fa294596e89b1c52fcd2592 Mon Sep 17 00:00:00 2001 From: Michael Fan Date: Tue, 24 Mar 2026 18:52:06 -0400 Subject: [PATCH] codex: fix remaining CI failures on PR #15561 Skip redundant cargo-home cache saves in Windows test jobs to avoid post-test timeouts, and add the required argument comments in the login OAuth helper. Co-authored-by: Codex --- .github/workflows/rust-ci.yml | 4 +++- codex-rs/login/src/onboard_oauth_helper.rs | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index c203e2b742..7115502364 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -494,8 +494,10 @@ jobs: # Save caches explicitly; make non-fatal so cache packaging # never fails the overall job. Only save when key wasn't hit. + # Lint/build jobs already save this cache key. Skipping the redundant + # Windows test-job save keeps the test jobs within their timeout budget. - name: Save cargo home cache - if: always() && !cancelled() && steps.cache_cargo_home_restore.outputs.cache-hit != 'true' + if: always() && !cancelled() && !startsWith(matrix.runner, 'windows') && steps.cache_cargo_home_restore.outputs.cache-hit != 'true' continue-on-error: true uses: actions/cache/save@v5 with: diff --git a/codex-rs/login/src/onboard_oauth_helper.rs b/codex-rs/login/src/onboard_oauth_helper.rs index 76678031a5..5787cc9c40 100644 --- a/codex-rs/login/src/onboard_oauth_helper.rs +++ b/codex-rs/login/src/onboard_oauth_helper.rs @@ -511,14 +511,17 @@ fn handle_callback_request( Ok(url) => url, Err(err) => { return CallbackResponse { - response: html_response(400, format!("

Bad Request

{err}

")), + response: html_response( + /*status*/ 400, + format!("

Bad Request

{err}

"), + ), result: None, }; } }; if parsed_url.path() != callback_path { return CallbackResponse { - response: html_response(404, "

Not Found

".to_string()), + response: html_response(/*status*/ 404, "

Not Found

".to_string()), result: None, }; } @@ -526,7 +529,7 @@ fn handle_callback_request( let params: HashMap = parsed_url.query_pairs().into_owned().collect(); if params.get("state").map(String::as_str) != Some(expected_state) { return CallbackResponse { - response: html_response(400, "

State mismatch

".to_string()), + response: html_response(/*status*/ 400, "

State mismatch

".to_string()), result: Some(Err("State mismatch in OAuth callback.".to_string())), }; } @@ -537,7 +540,7 @@ fn handle_callback_request( ); return CallbackResponse { response: html_response( - 403, + /*status*/ 403, "

Sign-in failed

Return to your terminal.

".to_string(), ), result: Some(Err(message)), @@ -546,13 +549,16 @@ fn handle_callback_request( match params.get("code") { Some(code) if !code.is_empty() => CallbackResponse { response: html_response( - 200, + /*status*/ 200, "

Sign-in complete

You can return to your terminal.

".to_string(), ), result: Some(Ok(code.clone())), }, _ => CallbackResponse { - response: html_response(400, "

Missing authorization code

".to_string()), + response: html_response( + /*status*/ 400, + "

Missing authorization code

".to_string(), + ), result: Some(Err( "Missing authorization code. Sign-in could not be completed.".to_string(), )),