MCPcopy Create free account
hub / github.com/FIND-Lab/AgentWard / resolveApprovalTimeoutMs

Function resolveApprovalTimeoutMs

index.ts:68–78  ·  view source on GitHub ↗
(config: PluginConfig)

Source from the content-addressed store, hash-verified

66}
67
68function resolveApprovalTimeoutMs(config: PluginConfig): number | undefined {
69 const timeoutMs = config.approvals?.timeoutMs;
70 // Undefined -> let OpenClaw use its default (currently 120s).
71 if (timeoutMs === undefined) return undefined;
72 // null -> "infinite" (best-effort). OpenClaw gateway caps approvals at 10 minutes.
73 // We'll request the maximum cap to approximate infinity.
74 if (timeoutMs === null) return 600000;
75 if (typeof timeoutMs === "number" && Number.isFinite(timeoutMs) && timeoutMs > 0) return Math.trunc(timeoutMs);
76 // <=0 treated as "infinite" in config parser; but be defensive.
77 return 600000;
78}
79
80const plugin = {
81 id: "agent-ward",

Callers 1

registerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected