refactor: centralize config update logging

This commit is contained in:
Peter Steinberger
2026-01-23 04:01:11 +00:00
parent 246ee490f6
commit e750ad5e75
20 changed files with 73 additions and 70 deletions

View File

@@ -1,7 +1,6 @@
import { CONFIG_PATH_CLAWDBOT } from "../../config/config.js";
import { logConfigUpdated } from "../../config/logging.js";
import type { RuntimeEnv } from "../../runtime.js";
import { resolveModelTarget, updateConfig } from "./shared.js";
import { shortenHomePath } from "../../utils.js";
export async function modelsSetCommand(modelRaw: string, runtime: RuntimeEnv) {
const updated = await updateConfig((cfg) => {
@@ -28,6 +27,6 @@ export async function modelsSetCommand(modelRaw: string, runtime: RuntimeEnv) {
};
});
runtime.log(`Updated ${shortenHomePath(CONFIG_PATH_CLAWDBOT)}`);
logConfigUpdated(runtime);
runtime.log(`Default model: ${updated.agents?.defaults?.model?.primary ?? modelRaw}`);
}