mirror of
https://github.com/stablyai/orca.git
synced 2026-09-23 16:02:24 +00:00
* fix(cli): bound orchestration ask timeouts * fix(cli): harden remote timeout boundaries
15 lines
611 B
TypeScript
15 lines
611 B
TypeScript
export const ORCHESTRATION_ASK_DEFAULT_TIMEOUT_MS = 600_000
|
|
export const ORCHESTRATION_ASK_MAX_TIMEOUT_MS = 1_800_000
|
|
export const ORCHESTRATION_ASK_CLIENT_GRACE_MS = 5_000
|
|
|
|
export function clampOrchestrationAskTimeoutMs(timeoutMs: number | undefined): number {
|
|
if (timeoutMs === undefined) {
|
|
return ORCHESTRATION_ASK_DEFAULT_TIMEOUT_MS
|
|
}
|
|
return Math.min(Math.max(0, timeoutMs), ORCHESTRATION_ASK_MAX_TIMEOUT_MS)
|
|
}
|
|
|
|
export function resolveOrchestrationAskClientTimeoutMs(timeoutMs: number | undefined): number {
|
|
return clampOrchestrationAskTimeoutMs(timeoutMs) + ORCHESTRATION_ASK_CLIENT_GRACE_MS
|
|
}
|