e1c6bf92fb
Add a `providerExecuted: boolean` flag to `tool-call` and `tool-result` events plus the persisted `ToolResultPart`. When set, the tool runtime skips client dispatch (the provider already executed the tool) and folds both events into the assistant message so the next round's history carries the call + result for context. Anthropic: decode `server_tool_use` blocks and the three server tool result block types (`web_search_tool_result`, `code_execution_tool_result`, `web_fetch_tool_result`) into `tool-call` / `tool-result` events with `providerExecuted: true`. Round-trip the same parts back into the provider when the assistant message is replayed in subsequent requests. Result block error payloads (`*_tool_result_error`) surface as `result.type === "error"`. OpenAI Responses: decode hosted tool items emitted via `response.output_item.done` (`web_search_call`, `file_search_call`, `code_interpreter_call`, `computer_use_call`, `image_generation_call`, `mcp_call`, `local_shell_call`) as `tool-call` + `tool-result` pairs with `providerExecuted: true`. Each tool's input fields are pulled out explicitly; the full item is passed through as the result payload so consumers can read outputs / sources / status without re-decoding. Tool runtime: extend the dispatch decision so provider-executed tool-calls bypass the handler lookup, and tool-result events with `providerExecuted: true` are appended to the assistant content for round-trip rather than being treated as a separate tool message. Tests: 7 new deterministic fixtures cover Anthropic decode (success + error result + round-trip + unknown server tool name), OpenAI Responses decode (web_search_call, code_interpreter_call), and tool-runtime skip-dispatch. AGENTS.md updates the runtime section to describe pass-through behavior and notes the transport-agnostic design that keeps a future WebSocket adapter (e.g. OpenAI Codex backend) as a sibling rather than a core rewrite.