mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 14:00:42 +00:00
22 lines
684 B
TypeScript
22 lines
684 B
TypeScript
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-types";
|
|
|
|
type ReasoningDefault = "on" | "stream" | "off";
|
|
|
|
const DEFAULT_AGENT_ID = "main";
|
|
|
|
function normalizeAgentId(value: string | undefined | null): string {
|
|
const normalized = (value ?? "").trim().toLowerCase();
|
|
return normalized || DEFAULT_AGENT_ID;
|
|
}
|
|
|
|
export function resolveTelegramConfigReasoningDefault(
|
|
cfg: OpenClawConfig,
|
|
agentId: string,
|
|
): ReasoningDefault {
|
|
const id = normalizeAgentId(agentId);
|
|
const agentDefault = cfg.agents?.list?.find(
|
|
(entry) => normalizeAgentId(entry?.id) === id,
|
|
)?.reasoningDefault;
|
|
return agentDefault ?? cfg.agents?.defaults?.reasoningDefault ?? "off";
|
|
}
|