mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 13:11:22 +00:00
refactor: rename to openclaw
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
import type { MoltbotConfig } from "../config/config.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
|
||||
const DEFAULT_AGENT_TIMEOUT_SECONDS = 600;
|
||||
|
||||
const normalizeNumber = (value: unknown): number | undefined =>
|
||||
typeof value === "number" && Number.isFinite(value) ? Math.floor(value) : undefined;
|
||||
|
||||
export function resolveAgentTimeoutSeconds(cfg?: MoltbotConfig): number {
|
||||
export function resolveAgentTimeoutSeconds(cfg?: OpenClawConfig): number {
|
||||
const raw = normalizeNumber(cfg?.agents?.defaults?.timeoutSeconds);
|
||||
const seconds = raw ?? DEFAULT_AGENT_TIMEOUT_SECONDS;
|
||||
return Math.max(seconds, 1);
|
||||
}
|
||||
|
||||
export function resolveAgentTimeoutMs(opts: {
|
||||
cfg?: MoltbotConfig;
|
||||
cfg?: OpenClawConfig;
|
||||
overrideMs?: number | null;
|
||||
overrideSeconds?: number | null;
|
||||
minMs?: number;
|
||||
|
||||
Reference in New Issue
Block a user