mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
Add output schema to MCP tools and expose MCP tool results in code mode (#14236)
Summary - drop `McpToolOutput` in favor of `CallToolResult`, moving its helpers to keep MCP tooling focused on the final result shape - wire the new schema definitions through code mode, context, handlers, and spec modules so MCP tools serialize the exact output shape expected by the model - extend code mode tests to cover multiple MCP call scenarios and ensure the serialized data matches the new schema - refresh JS runner helpers and protocol models alongside the schema changes Testing - Not run (not requested)
This commit is contained in:
committed by
Michael Bolin
parent
d5694529ca
commit
ee8f84153e
@@ -622,7 +622,7 @@ impl JsReplManager {
|
||||
}
|
||||
ResponseInputItem::McpToolCallOutput { output, .. } => {
|
||||
let function_output = output.as_function_call_output_payload();
|
||||
let payload_kind = if output.success {
|
||||
let payload_kind = if output.success() {
|
||||
JsReplToolCallPayloadKind::McpResult
|
||||
} else {
|
||||
JsReplToolCallPayloadKind::McpErrorResult
|
||||
@@ -634,7 +634,7 @@ impl JsReplManager {
|
||||
);
|
||||
summary.payload_item_count = Some(output.content.len());
|
||||
summary.structured_content_present = Some(output.structured_content.is_some());
|
||||
summary.result_is_error = Some(!output.success);
|
||||
summary.result_is_error = Some(!output.success());
|
||||
summary
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user