Skip to main content

Module tool_handler

Module tool_handler 

Source
Expand description

Codex-compatible ToolHandler trait and types

This module implements the handler pattern from OpenAI’s Codex project, providing a more modular and composable approach to tool execution.

Key patterns from Codex:

  • ToolHandler trait with kind/matches_kind/is_mutating/handle methods
  • ToolKind enum for categorizing tool types
  • ToolPayload for typed tool arguments
  • ToolOutput for structured tool results
  • ToolInvocation for execution context

Structs§

ConfiguredToolSpec
Configured tool spec with parallel execution support
Constrained
Lightweight wrapper used to preserve policy fields as structured values.
DiffTracker
Diff tracker for file changes
FreeformTool
FreeformToolFormat
McpToolResult
MCP tool result (from Codex)
PatchApplyBeginEvent
PatchApplyEndEvent
ResponsesApiTool
ShellToolCallParams
Shell command parameters (from Codex)
ToolEventBegin
ToolEventFailure
ToolEventSuccess
ToolInvocation
Context for tool invocation (from Codex)
TurnContext
Turn context for tool execution

Enums§

AdditionalProperties
ApprovalPolicy
Approval policy for tool execution
ContentItem
Content item for multi-part responses (from Codex)
FileChange
File change types (from Codex protocol)
SandboxPermissions
Sandbox permission levels (from Codex)
ShellEnvironmentPolicy
Shell environment policy
ToolCallError
Error type for tool execution (from Codex)
ToolEvent
Tool execution events (from Codex)
ToolKind
Tool kind classification (from Codex)
ToolOutput
Tool output types (from Codex)
ToolPayload
Payload types for tool invocations (from Codex)
ToolSpec
Tool spec types (from Codex)

Traits§

ToolHandler
Core trait for tool handlers (from Codex)
ToolSession
Session trait for tool execution context

Type Aliases§

JsonSchema
SharedDiffTracker
Shared diff tracker type alias