From 697c7cf4bfadd8d4a090c0c32bac07c88707009d Mon Sep 17 00:00:00 2001 From: Gabriel Peal Date: Fri, 22 Aug 2025 15:46:35 -0700 Subject: [PATCH] Fix flakiness in shell command approval test (#2547) ## Summary - read the shell exec approval request's actual id instead of assuming it is always 0 - use that id when validating and responding in the test ## Testing - `cargo test -p codex-mcp-server test_shell_command_approval_triggers_elicitation` ------ https://chatgpt.com/codex/tasks/task_i_68a6ab9c732c832c81522cbf11812be0 --- codex-rs/mcp-server/tests/codex_tool.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/codex-rs/mcp-server/tests/codex_tool.rs b/codex-rs/mcp-server/tests/codex_tool.rs index 1ebd10a7..13866d97 100644 --- a/codex-rs/mcp-server/tests/codex_tool.rs +++ b/codex-rs/mcp-server/tests/codex_tool.rs @@ -86,9 +86,7 @@ async fn shell_command_approval_triggers_elicitation() -> anyhow::Result<()> { ) .await??; - // This is the first request from the server, so the id should be 0 given - // how things are currently implemented. - let elicitation_request_id = RequestId::Integer(0); + let elicitation_request_id = elicitation_request.id.clone(); let params = serde_json::from_value::( elicitation_request .params