mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
fix(agents): fall back to agents.defaults.model when agent has no model config (#24210)
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: 0f272b1027
Co-authored-by: bianbiandashen <16240681+bianbiandashen@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
@@ -96,7 +96,11 @@ export function createLlmTaskTool(api: OpenClawPluginApi) {
|
||||
|
||||
const pluginCfg = (api.pluginConfig ?? {}) as PluginCfg;
|
||||
|
||||
const primary = api.config?.agents?.defaults?.model?.primary;
|
||||
const defaultsModel = api.config?.agents?.defaults?.model;
|
||||
const primary =
|
||||
typeof defaultsModel === "string"
|
||||
? defaultsModel.trim()
|
||||
: (defaultsModel?.primary?.trim() ?? undefined);
|
||||
const primaryProvider = typeof primary === "string" ? primary.split("/")[0] : undefined;
|
||||
const primaryModel =
|
||||
typeof primary === "string" ? primary.split("/").slice(1).join("/") : undefined;
|
||||
|
||||
Reference in New Issue
Block a user