diff --git a/codex-rs/core/src/chat_completions.rs b/codex-rs/core/src/chat_completions.rs index 5f8b37c67f..7b50a3d1c4 100644 --- a/codex-rs/core/src/chat_completions.rs +++ b/codex-rs/core/src/chat_completions.rs @@ -500,7 +500,7 @@ mod tests { /// Validate that `stream_chat_completions` converts our internal `Prompt` into the exact /// Chat Completions JSON payload expected by OpenAI. We build a prompt containing user - ////assistant turns, a function call and its output, issue the request against a + /// assistant turns, a function call and its output, issue the request against a /// `wiremock::MockServer`, capture the JSON body, and assert that the full `messages` array /// matches a golden value. The test is a pure unit-test; it is skipped automatically when /// the sandbox disables networking. diff --git a/codex-rs/core/src/openai_tools.rs b/codex-rs/core/src/openai_tools.rs index e8bb253f85..7e3f86fda8 100644 --- a/codex-rs/core/src/openai_tools.rs +++ b/codex-rs/core/src/openai_tools.rs @@ -207,6 +207,9 @@ mod tests { assert_eq!(dummy, &expected_dummy); } + /// When the model name starts with `codex-`, the built-in shell tool should be encoded + /// as `local_shell` rather than `shell`. Verify that the first tool in the JSON list has + /// the adjusted type in that scenario. #[test] fn responses_codex_model_uses_local_shell() { let mut prompt = Prompt::default(); @@ -217,6 +220,9 @@ mod tests { assert_eq!(tools[0]["type"], "local_shell"); } + /// Chat-Completions API expects the V2 tool schema (`{"type":"function","function":{..}}`). + /// Confirm that every entry is shaped accordingly and the wrapper does not leak the internal + /// `type` field inside the nested `function` object. #[test] fn chat_completions_tool_format() { let mut prompt = Prompt::default();