fix(auth): use correct model config format (object, not string)

OpenClaw expects agents.defaults.model as { primary: "provider/model" }
not a plain string. The previous code wrote a string which caused:
"agents.defaults.model: Invalid input: expected object, received string"
This commit is contained in:
Haze
2026-02-06 03:31:24 +08:00
Unverified
parent 4b9ab69b9b
commit a92ced3c4a

View File

@@ -197,9 +197,10 @@ export function setOpenClawDefaultModel(provider: string): void {
}
// Set the default model for the agents
// model must be an object: { primary: "provider/model", fallbacks?: [] }
const agents = (config.agents || {}) as Record<string, unknown>;
const defaults = (agents.defaults || {}) as Record<string, unknown>;
defaults.model = model;
defaults.model = { primary: model };
agents.defaults = defaults;
config.agents = agents;