pub struct ToolCall {Show 16 fields
pub tool_call_id: ToolCallId,
pub mcp_call_id: Option<McpCallId>,
pub model_visible_call_id: Option<ModelVisibleCallId>,
pub code_mode_runtime_tool_id: Option<CodeModeRuntimeToolId>,
pub thread_id: AgentThreadId,
pub started_by_codex_turn_id: Option<CodexTurnId>,
pub execution: ExecutionWindow,
pub requester: ToolCallRequester,
pub kind: ToolCallKind,
pub model_visible_call_item_ids: Vec<ConversationItemId>,
pub model_visible_output_item_ids: Vec<ConversationItemId>,
pub terminal_operation_id: Option<TerminalOperationId>,
pub summary: ToolCallSummary,
pub raw_invocation_payload_id: Option<RawPayloadId>,
pub raw_result_payload_id: Option<RawPayloadId>,
pub raw_runtime_payload_ids: Vec<RawPayloadId>,
}Expand description
Public reduced trace model returned by replay. Runtime operation requested by the model, a JS code cell, or Codex itself.
A ToolCall is not a chat transcript row. Model-visible call/output items
link to it through model_visible_*_item_ids; runtime-only tools can have
empty model-visible lists.
Fields§
§tool_call_id: ToolCallId§mcp_call_id: Option<McpCallId>Globally unique MCP execution ID, when this tool reached an MCP backend.
model_visible_call_id: Option<ModelVisibleCallId>Model-visible protocol call ID, if the model directly requested this tool.
code_mode_runtime_tool_id: Option<CodeModeRuntimeToolId>Code-mode runtime’s internal tool invocation ID, if this call came from JS.
thread_id: AgentThreadId§started_by_codex_turn_id: Option<CodexTurnId>Runtime activation that started the tool. Background work may outlive this turn.
execution: ExecutionWindow§requester: ToolCallRequester§kind: ToolCallKind§model_visible_call_item_ids: Vec<ConversationItemId>§model_visible_output_item_ids: Vec<ConversationItemId>§terminal_operation_id: Option<TerminalOperationId>Terminal operation started by this tool, when the tool touched a terminal.
summary: ToolCallSummary§raw_invocation_payload_id: Option<RawPayloadId>Original invocation at the Codex tool boundary.
Direct model tools store the model’s function/custom call payload here. Code-mode nested tools store the JSON call made by model-authored JS. Runtime protocol events are deliberately kept separate below because they describe how Codex executed the request, not what the caller sent.
raw_result_payload_id: Option<RawPayloadId>Result returned to the immediate requester.
For direct tools this is the tool output item returned to the model; for code-mode nested tools this is the value returned to JavaScript.
raw_runtime_payload_ids: Vec<RawPayloadId>Runtime/protocol payloads observed while executing the tool.
Examples include exec begin/end, patch begin/end, and MCP begin/end events. Reducers can use these to build richer runtime objects such as terminal operations without overwriting the canonical invocation/result.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ToolCall
impl<'de> Deserialize<'de> for ToolCall
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for ToolCall
Auto Trait Implementations§
impl Freeze for ToolCall
impl RefUnwindSafe for ToolCall
impl Send for ToolCall
impl Sync for ToolCall
impl Unpin for ToolCall
impl UnsafeUnpin for ToolCall
impl UnwindSafe for ToolCall
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more