fix: mergeDeep only accepts 2 arguments - chain calls to fix CLI crash

Fixes remeda mergeDeep error that was causing all OpenCode CLI commands
to fail with 'Wrong number of arguments' before processing any messages.

The bug was introduced in commit 2536784 where providerPreference support
was added, passing 3 arguments to mergeDeep which only accepts 2.

Changed from:
  mergeDeep(A, B, C)
To:
  mergeDeep(mergeDeep(A, B), C)

This preserves the provider preference functionality while fixing the crash.
This commit is contained in:
southseact-3d
2026-02-19 15:50:39 +00:00
parent 237f10d6ef
commit a0eb6408f1

View File

@@ -940,7 +940,10 @@ export namespace Provider {
write: model?.cost?.cache_write ?? existingModel?.cost?.cache.write ?? 0, write: model?.cost?.cache_write ?? existingModel?.cost?.cache.write ?? 0,
}, },
}, },
options: mergeDeep(existingModel?.options ?? {}, model.options ?? {}, model.providerPreference ? { providerPreference: model.providerPreference } : {}), options: mergeDeep(
mergeDeep(existingModel?.options ?? {}, model.options ?? {}),
model.providerPreference ? { providerPreference: model.providerPreference } : {}
),
limit: { limit: {
context: model.limit?.context ?? existingModel?.limit?.context ?? 0, context: model.limit?.context ?? existingModel?.limit?.context ?? 0,
output: model.limit?.output ?? existingModel?.limit?.output ?? 0, output: model.limit?.output ?? existingModel?.limit?.output ?? 0,