Expand description
Classifies what produced a tool_result so the proxy never lossy-compresses
a file/source-code read the model still needs (e.g. mid-refactor).
The request body only carries the tool result plus an id linking it to the
originating tool call. We resolve that id → tool name from the assistant’s
tool_use / tool_calls / function_call items, then map the name to a
ToolResultKind. A content heuristic (looks_like_source_code) is the
fallback for unknown/custom tools so a file read through a non-standard tool
is still protected.
Enums§
- Tool
Result Kind - What kind of tool produced a
tool_result.
Functions§
- anthropic_
tool_ names - Builds a
tool_use_id → tool_namemap from Anthropicmessages. - classify_
tool_ name - Maps a tool name (from any agent) to a
ToolResultKind. - looks_
like_ source_ code - Heuristic fallback: does this text look like source code (vs command output)?
- openai_
tool_ names - Builds a
tool_call_id → function_namemap from OpenAI Chat Completionsmessages(assistanttool_calls[]). - responses_
tool_ names - Builds a
call_id → namemap from OpenAI Responsesinputitems (type:"function_call"). - should_
protect - Whether a
tool_resultwith the given resolved kind and content must be preserved intact (never lossy-compressed) by the proxy.