feat(codex): add support for mcpToolCall item type (#159)

This commit is contained in:
João Salavisa
2026-02-02 23:17:28 +00:00
committed by GitHub
parent 0de3c31ddc
commit 4eaf467950
3 changed files with 104 additions and 14 deletions
+8 -1
View File
@@ -177,7 +177,7 @@ type TurnStartResult struct {
// Item represents a Codex item (message, command, file change, etc.)
type Item struct {
ID string `json:"id"`
Type string `json:"type"` // "userMessage", "agentMessage", "commandExecution", "fileChange", "reasoning"
Type string `json:"type"` // "userMessage", "agentMessage", "commandExecution", "fileChange", "reasoning", "mcpToolCall"
Status string `json:"status"` // "inProgress", "completed", "failed"
// For commandExecution type
@@ -194,6 +194,13 @@ type Item struct {
// or plain strings. FlexibleContent handles both formats.
Summary FlexibleContent `json:"summary,omitempty"`
Content FlexibleContent `json:"content,omitempty"`
// For mcpToolCall type
Server string `json:"server,omitempty"`
Tool string `json:"tool,omitempty"`
Arguments json.RawMessage `json:"arguments,omitempty"`
Result json.RawMessage `json:"result,omitempty"`
ToolError string `json:"error,omitempty"` // Named ToolError to avoid conflict with Error type
}
// ContentPart represents a content part in a Codex item.