fix(mcp): include threadId in both content and structuredContent in CallToolResult (#9338)

This commit is contained in:
Michael Bolin
2026-01-15 18:33:11 -08:00
committed by GitHub
parent a6324ab34b
commit 99f47d6e9a
5 changed files with 86 additions and 23 deletions

View File

@@ -105,6 +105,24 @@ While a conversation runs, the server sends notifications:
Clients should render events and, when present, surface approval requests (see next section).
## Tool responses
The `codex` and `codex-reply` tools return standard MCP `CallToolResult` payloads. For
compatibility with MCP clients that prefer `structuredContent`, Codex mirrors the
content blocks inside `structuredContent` alongside the `threadId`.
Example:
```json
{
"content": [{ "type": "text", "text": "Hello from Codex" }],
"structuredContent": {
"threadId": "019bbed6-1e9e-7f31-984c-a05b65045719",
"content": "Hello from Codex"
}
}
```
## Approvals (server → client)
When Codex needs approval to apply changes or run commands, the server issues JSONRPC requests to the client: