diff options
| author | zerone0x <[email protected]> | 2026-01-25 02:07:04 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-01-24 13:07:04 -0500 |
| commit | 087d7da14debf3ae3701d7dd787c34cd2d0b57c8 (patch) | |
| tree | 3ebc81c684b2f15774a60625c11d7e57c53ece9d | |
| parent | 442a735883c2067cd5237f7689bd33b13213b566 (diff) | |
| download | opencode-087d7da14debf3ae3701d7dd787c34cd2d0b57c8.tar.gz opencode-087d7da14debf3ae3701d7dd787c34cd2d0b57c8.zip | |
fix(provider): deep merge providerOptions in applyCaching (#10323)
Co-authored-by: Claude <[email protected]>
| -rw-r--r-- | packages/opencode/src/provider/transform.ts | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/packages/opencode/src/provider/transform.ts b/packages/opencode/src/provider/transform.ts index 0ce5214a2..acccbd1c0 100644 --- a/packages/opencode/src/provider/transform.ts +++ b/packages/opencode/src/provider/transform.ts @@ -1,5 +1,5 @@ import type { APICallError, ModelMessage } from "ai" -import { unique } from "remeda" +import { mergeDeep, unique } from "remeda" import type { JSONSchema } from "zod/v4/core" import type { Provider } from "./provider" import type { ModelsDev } from "./models" @@ -186,18 +186,12 @@ export namespace ProviderTransform { if (shouldUseContentOptions) { const lastContent = msg.content[msg.content.length - 1] if (lastContent && typeof lastContent === "object") { - lastContent.providerOptions = { - ...lastContent.providerOptions, - ...providerOptions, - } + lastContent.providerOptions = mergeDeep(lastContent.providerOptions ?? {}, providerOptions) continue } } - msg.providerOptions = { - ...msg.providerOptions, - ...providerOptions, - } + msg.providerOptions = mergeDeep(msg.providerOptions ?? {}, providerOptions) } return msgs |
