mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-26 16:19:40 +00:00
fix(llm): stabilize anthropic tool result typecheck (#28909)
This commit is contained in:
parent
5ee0238c4a
commit
14c511e380
1 changed files with 3 additions and 1 deletions
|
|
@ -335,7 +335,9 @@ const lowerToolResultContent = Effect.fn("AnthropicMessages.lowerToolResultConte
|
|||
// Text / json / error results stay as a string for backward compatibility
|
||||
// with existing cassettes and provider expectations.
|
||||
if (part.result.type !== "content") return ProviderShared.toolResultText(part)
|
||||
return yield* Effect.forEach(part.result.value, lowerToolResultContentItem)
|
||||
// Preserve the narrowed array element type when compiled through a consumer package.
|
||||
const content: ReadonlyArray<ToolResultContentPart> = part.result.value
|
||||
return yield* Effect.forEach(content, lowerToolResultContentItem)
|
||||
})
|
||||
|
||||
const lowerMessages = Effect.fn("AnthropicMessages.lowerMessages")(function* (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue