[codex] preserve MCP result meta in McpToolCallItemResult (#22946)

## Summary

https://openai.slack.com/archives/C0ARA9UAQEA/p1778890981647319?thread_ts=1778888537.934319&cid=C0ARA9UAQEA


- Add `_meta` to exec JSONL MCP tool call result events.
- Copy MCP result metadata through the JSONL event conversion.
- Add a focused test that verifies `_meta` is serialized as `_meta` and
not `meta`.


## Verification

https://www.notion.so/openai/Miaolin-0516-_meta-population-debug-3628e50b62b08074b365e0ce1ffb8f74
This commit is contained in:
Miaolin Min
2026-05-16 13:27:44 -07:00
committed by GitHub
parent b200dd1b6f
commit 6941f5c2c5
5 changed files with 58 additions and 0 deletions
@@ -540,6 +540,7 @@ fn mcp_tool_call_begin_and_end_emit_item_events() {
arguments: json!({ "key": "value" }),
result: Some(McpToolCallItemResult {
content: Vec::new(),
meta: None,
structured_content: None,
}),
error: None,
@@ -681,6 +682,7 @@ fn mcp_tool_call_defaults_arguments_and_preserves_structured_content() {
"type": "text",
"text": "done",
})],
meta: None,
structured_content: Some(json!({ "status": "ok" })),
}),
error: None,