refactor(runtime): centralize lifecycle constants

This commit is contained in:
ZacharyZhang-NY committed 2026-04-22 16:58:36 -04:00
1 parent e540cbb2a6
commit fa006524c2
6 files changed
+49 -14

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
/**
* Task and workspace locks are considered stale after 15 minutes. The window
* covers heartbeat cadence, worst-case model/tool round trips, and shutdown
* recovery margin while still releasing abandoned work within one operator
* session.
*/
export const STALE_LOCK_TIMEOUT_MS = 15 * 60 * 1000;
export const DOCUMENT_LIFECYCLE_PROCESSOR_DEFAULTS = {
/** Five attempts cover transient filesystem/indexing failures without hiding a broken hook. */
maxAttempts: 5,
/** Document hooks are local metadata side effects; 60s separates a dead handler from a slow one. */
staleRunningMs: 60_000,
/** Keeps a burst of document hooks efficient while bounding one sweep's synchronous work. */
batchSize: 32,
/** Recovers crash leftovers quickly without turning idle profiles into polling loops. */
sweepIntervalMs: 15_000,
} as const;