mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 14:28:27 +00:00
Fix a subtle bug: modelDefault doesn’t apply when provider === "auto" (#2576)
* Fix a subtle bug: `modelDefault` doesn’t apply when provider === "auto" 1.Fix bugs when provider === "auto" which can lead model end up get "" 2. Fix to only include remote if you actually have any remote fields. (Is this intentional?) * Refactor memory-search.ts to simplify remote checks Remove redundant hasRemote variable and simplify includeRemote condition. * oxfmt-friendly version oxfmt-friendly version * fix: local updates for PR #2576 Co-authored-by: papago2355 <papago2355@users.noreply.github.com> * fix: memory search auto defaults (#2576) (thanks @papago2355) --------- Co-authored-by: Gustavo Madeira Santana <gumadeiras@gmail.com> Co-authored-by: papago2355 <papago2355@users.noreply.github.com>
This commit is contained in:
@@ -119,9 +119,16 @@ function mergeConfig(
|
||||
const provider = overrides?.provider ?? defaults?.provider ?? "auto";
|
||||
const defaultRemote = defaults?.remote;
|
||||
const overrideRemote = overrides?.remote;
|
||||
const hasRemote = Boolean(defaultRemote || overrideRemote);
|
||||
const hasRemoteConfig = Boolean(
|
||||
overrideRemote?.baseUrl ||
|
||||
overrideRemote?.apiKey ||
|
||||
overrideRemote?.headers ||
|
||||
defaultRemote?.baseUrl ||
|
||||
defaultRemote?.apiKey ||
|
||||
defaultRemote?.headers,
|
||||
);
|
||||
const includeRemote =
|
||||
hasRemote || provider === "openai" || provider === "gemini" || provider === "auto";
|
||||
hasRemoteConfig || provider === "openai" || provider === "gemini" || provider === "auto";
|
||||
const batch = {
|
||||
enabled: overrideRemote?.batch?.enabled ?? defaultRemote?.batch?.enabled ?? true,
|
||||
wait: overrideRemote?.batch?.wait ?? defaultRemote?.batch?.wait ?? true,
|
||||
|
||||
Reference in New Issue
Block a user