mirror of
https://github.com/openai/codex.git
synced 2026-05-01 09:56:37 +00:00
Reuse McpToolOutput in McpHandler (#14229)
We already have a type to represent the MCP tool output, reuse it instead of the custom McpHandlerOutput
This commit is contained in:
@@ -58,6 +58,7 @@ use codex_app_server_protocol::AppInfo;
|
||||
use codex_otel::TelemetryAuthMode;
|
||||
use codex_protocol::models::BaseInstructions;
|
||||
use codex_protocol::models::ContentItem;
|
||||
use codex_protocol::models::McpToolOutput;
|
||||
use codex_protocol::models::ResponseInputItem;
|
||||
use codex_protocol::models::ResponseItem;
|
||||
use codex_protocol::openai_models::ModelsResponse;
|
||||
@@ -1607,7 +1608,7 @@ fn prefers_structured_content_when_present() {
|
||||
meta: None,
|
||||
};
|
||||
|
||||
let got = FunctionCallOutputPayload::from(&ctr);
|
||||
let got = McpToolOutput::from(&ctr).into_function_call_output_payload();
|
||||
let expected = FunctionCallOutputPayload {
|
||||
body: FunctionCallOutputBody::Text(
|
||||
serde_json::to_string(&json!({
|
||||
@@ -1689,7 +1690,7 @@ fn falls_back_to_content_when_structured_is_null() {
|
||||
meta: None,
|
||||
};
|
||||
|
||||
let got = FunctionCallOutputPayload::from(&ctr);
|
||||
let got = McpToolOutput::from(&ctr).into_function_call_output_payload();
|
||||
let expected = FunctionCallOutputPayload {
|
||||
body: FunctionCallOutputBody::Text(
|
||||
serde_json::to_string(&vec![text_block("hello"), text_block("world")]).unwrap(),
|
||||
@@ -1709,7 +1710,7 @@ fn success_flag_reflects_is_error_true() {
|
||||
meta: None,
|
||||
};
|
||||
|
||||
let got = FunctionCallOutputPayload::from(&ctr);
|
||||
let got = McpToolOutput::from(&ctr).into_function_call_output_payload();
|
||||
let expected = FunctionCallOutputPayload {
|
||||
body: FunctionCallOutputBody::Text(
|
||||
serde_json::to_string(&json!({ "message": "bad" })).unwrap(),
|
||||
@@ -1729,7 +1730,7 @@ fn success_flag_true_with_no_error_and_content_used() {
|
||||
meta: None,
|
||||
};
|
||||
|
||||
let got = FunctionCallOutputPayload::from(&ctr);
|
||||
let got = McpToolOutput::from(&ctr).into_function_call_output_payload();
|
||||
let expected = FunctionCallOutputPayload {
|
||||
body: FunctionCallOutputBody::Text(
|
||||
serde_json::to_string(&vec![text_block("alpha")]).unwrap(),
|
||||
|
||||
Reference in New Issue
Block a user