Dashboard › opencode › Distillation
b1a69043-2639-4b0a-87ca-e354055bffe8["lore_tm_v1_AjC-E93WapQslSU79KIdsd5JW-1GJ-nGbX1KLBgACVM","lore_tm_v1_CPizHV6whOKHgwxJDm1Wi5KqaK3SW--A3rt-IgVr6w0","lore_tm_v1_SAzoK04Abq49kjbd4X4U9c5owB-ohUGy6IczZZjpYbU","lore_tm_v1_H33wqzMv5XP6UfsOyAeNjoRdlTYvcR8stKELCGds3FI","lore_tm_v1_RshaNyvxNR81Qz4sIOOGMy0wmj0gBAWKhfGbyWS-HAM","lore_tm_v1_MT16m2CblE2LGPMzDcNna2Yl6UavZDTDQTiZ0mD-Uiw"]
Date: Sep 16, 2026
/tmp/opencode/session-recovery-review.1VQHG0/packages/core/src/tool/registry.ts found that ToolRegistry.materialize() snapshots the currently active tool registrations and their object identities; its returned settle() calls settleWith(input, registration.identity), and settleWith() returns Stale tool call: ${input.call.name} if the current registration identity differs from the advertised identity./tmp/opencode/session-recovery-review.1VQHG0/packages/core/src/tool/registry.ts distinguishes missing tools during settlement as Stale tool call: ${input.call.name} when an advertised registration identity exists, otherwise Unknown tool: ${input.call.name}; a tool omitted from a materialized registry returns Unknown tool: ${input.call.name}.ToolRegistry.settleWith() in /tmp/opencode/session-recovery-review.1VQHG0/packages/core/src/tool/registry.ts:50-81 calls settle(registration.tool, input.call, { sessionID, agent, assistantMessageID, toolCallID }), converts LLM.ToolFailure into an error result using failure.message, bounds successful output through ToolOutputStore.Service.bound(), then returns result, optional output, and optional outputPaths./tmp/opencode/session-recovery-review.1VQHG0/packages/core/src/tool/registry.ts:85-105 validates every tool name, pushes scoped registrations into a per-name stack with a shared token, and removes only registrations carrying that token in an Effect.addFinalizer(); the most recently registered local tool overrides application tools./tmp/opencode/session-recovery-review.1VQHG0/packages/core/src/tool/tool.ts defines Tool.Context with sessionID, agent, assistantMessageID, and toolCallID; Runtime.settle has signature (call: ToolCall, context: Context) => Effect.Effect<ToolOutput, ToolFailure>.Tool.make() in /tmp/opencode/session-recovery-review.1VQHG0/packages/core/src/tool/tool.ts:71-130 caches ToolDefinition values by name, decodes call.input against config.input, executes config.execute(input, context), encodes the output against config.output, optionally derives and encodes config.structured via config.toStructuredOutput, and maps schema failures to ToolFailure messages beginning Invalid tool input: or Tool returned an invalid value for its output schema:./tmp/opencode/session-recovery-review.1VQHG0/packages/core/src/tool/tool.ts:113-125 emits text parts directly and converts file parts to data:${part.mime};base64,${part.data} URIs with mime and optional name; without toModelOutput, string outputs become one text part and non-string outputs produce no content parts./tmp/opencode/session-recovery-review.1VQHG0/packages/core/src/tool/tool.ts:134-137 by /^[A-Za-z][A-Za-z0-9_-]{0,63}$/; invalid names fail with Tool.RegistrationError and message Invalid tool name: ${name}.