refactor(agents): migrate console.warn/error/info to subsystem logger (#22906)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: a806c4cb27
Co-authored-by: Kepler2024 <166882517+Kepler2024@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
Harry Cui Kepler
2026-02-21 23:11:47 +01:00
committed by GitHub
parent 1257aee6e1
commit ffa63173e0
16 changed files with 79 additions and 50 deletions

View File

@@ -1,9 +1,12 @@
import type { OpenClawConfig } from "../config/config.js";
import { createSubsystemLogger } from "../logging/subsystem.js";
import { resolveAgentConfig, resolveAgentModelPrimary } from "./agent-scope.js";
import { DEFAULT_MODEL, DEFAULT_PROVIDER } from "./defaults.js";
import type { ModelCatalogEntry } from "./model-catalog.js";
import { normalizeGoogleModelId } from "./models-config.providers.js";
const log = createSubsystemLogger("model-selection");
export type ModelRef = {
provider: string;
model: string;
@@ -270,8 +273,8 @@ export function resolveConfiguredModelRef(params: {
}
// Default to anthropic if no provider is specified, but warn as this is deprecated.
console.warn(
`[openclaw] Model "${trimmed}" specified without provider. Falling back to "anthropic/${trimmed}". Please use "anthropic/${trimmed}" in your config.`,
log.warn(
`Model "${trimmed}" specified without provider. Falling back to "anthropic/${trimmed}". Please use "anthropic/${trimmed}" in your config.`,
);
return { provider: "anthropic", model: trimmed };
}