eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
52 lines • 2.46 kB
TypeScript
export declare const MAX_QUEUE_DELIVERIES = 48;
/**
* Default maximum time allowed for the *replay* portion of a single workflow
* handler invocation (in ms). This budget only covers deterministic-replay
* and workflow-VM execution between step boundaries — inline step bodies
* (`"use step"` functions invoked via `executeStep`) do NOT count against
* it. Step bodies are bounded separately by the platform's function
* `maxDuration` (e.g. 800s on Vercel Pro Fluid) and `NO_INLINE_REPLAY_AFTER_MS`.
*
* If the non-step ("replay") time within a single invocation exceeds this
* budget, the handler exits so the queue can retry. After
* `REPLAY_TIMEOUT_MAX_RETRIES` exhausted attempts the run is failed with
* `RUN_ERROR_CODES.REPLAY_TIMEOUT`.
*
* Note that on Vercel Hobby (standard functions), the platform `maxDuration`
* is 60s — well below this budget, so the platform SIGTERM will fire first
* and the queue will re-deliver until the visibility window expires. With
* Fluid Compute on Hobby the per-function ceiling rises to 300s, still
* under the default budget.
*
* Override via the `WORKFLOW_REPLAY_TIMEOUT_MS` env var (clamped to
* `MIN_REPLAY_TIMEOUT_MS`..`MAX_REPLAY_TIMEOUT_MS`).
*/
export declare const REPLAY_TIMEOUT_MS = 240000;
/** Lower bound for the replay-timeout env var override. */
export declare const MIN_REPLAY_TIMEOUT_MS = 30000;
/**
* Upper bound for the replay-timeout env var override. 780s leaves ≥20s of
* headroom under Vercel Pro Fluid's 800s function ceiling so the handler
* can write `run_failed` before SIGTERM.
*/
export declare const MAX_REPLAY_TIMEOUT_MS = 780000;
/**
* Resolve the effective replay-timeout budget for the current process.
*
* Reads `process.env.WORKFLOW_REPLAY_TIMEOUT_MS` lazily so tests and
* deployments can override per invocation. Invalid / out-of-range values
* fall back to a safe value (no throw — the env var is an escape hatch,
* not a hard requirement) and emit a one-time warning so misconfiguration
* is observable.
*/
export declare function getReplayTimeoutMs(): number;
/**
* Reset the warn-once cache. Test-only — exported so unit tests can
* exercise the warn path repeatedly without sharing state.
*
* @internal
*/
export declare function _resetReplayTimeoutWarnCacheForTests(): void;
export declare const REPLAY_TIMEOUT_MAX_RETRIES = 3;
export declare const REPLAY_DIVERGENCE_MAX_RETRIES = 3;
//# sourceMappingURL=constants.d.ts.map