mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-13 05:30:35 +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:
@@ -6,6 +6,7 @@ import { cancel, isCancel } from "@clack/prompts";
|
||||
import { DEFAULT_AGENT_WORKSPACE_DIR, ensureAgentWorkspace } from "../agents/workspace.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { CONFIG_PATH } from "../config/config.js";
|
||||
import { resolveAgentModelPrimaryValue } from "../config/model-input.js";
|
||||
import { resolveSessionTranscriptsDirForAgent } from "../config/sessions.js";
|
||||
import { callGateway } from "../gateway/call.js";
|
||||
import { normalizeControlUiBasePath } from "../gateway/control-ui-shared.js";
|
||||
@@ -43,7 +44,7 @@ export function summarizeExistingConfig(config: OpenClawConfig): string {
|
||||
rows.push(shortenHomeInString(`workspace: ${defaults.workspace}`));
|
||||
}
|
||||
if (defaults?.model) {
|
||||
const model = typeof defaults.model === "string" ? defaults.model : defaults.model.primary;
|
||||
const model = resolveAgentModelPrimaryValue(defaults.model);
|
||||
if (model) {
|
||||
rows.push(shortenHomeInString(`model: ${model}`));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user