Files
openclaw/src/tasks/runtime-internal.ts
Vincent Koc d6d7c19c9d fix(tasks): fail closed when task-flow state cannot restore (#105088)
* fix(tasks): fail closed on task-flow restore errors

* fix(tasks): keep maintenance checks behind owner seam

* fix(tasks): gate runtime startup on flow restore

* test(tasks): prove runtime restore gate failures

* fix(tasks): gate cancellation on flow readiness
2026-07-12 16:08:29 +08:00

55 lines
1.6 KiB
TypeScript

// Internal task registry facade used by runtime modules without exposing public SDK surface.
import {
ensureTaskFlowRegistryReady,
reloadTaskFlowRegistryFromStore,
} from "./task-flow-runtime-internal.js";
import {
ensureTaskRegistryReady as ensureTaskRegistryReadyInternal,
reloadTaskRegistryFromStore as reloadTaskRegistryFromStoreInternal,
} from "./task-registry.js";
export function ensureTaskRuntimeStateReady(): void {
ensureTaskFlowRegistryReady();
ensureTaskRegistryReadyInternal();
}
export function reloadTaskRuntimeStateFromStore(): void {
reloadTaskFlowRegistryFromStore();
reloadTaskRegistryFromStoreInternal();
}
export {
assertTaskCancellationReadyById,
cancelTaskById,
createTaskRecord,
deleteTaskRecordById,
ensureTaskRegistryReady,
resetTaskRegistryControlRuntimeForTests,
findLatestTaskForFlowId,
finalizeTaskRunByRunId,
getTaskById,
hasActiveTaskForChildSessionKey,
listFreshTasksForOwnerKey,
listTaskRecords,
listTaskRecordsUnsorted,
listTasksForFlowId,
listTasksForOwnerKey,
linkTaskToFlowById,
markTaskLostById,
markTaskRunningByRunId,
markTaskTerminalById,
maybeDeliverTaskTerminalUpdate,
recordTaskProgressByRunId,
reloadTaskRegistryFromStore,
resetTaskRegistryDeliveryRuntimeForTests,
resolveTaskForLookupToken,
resetTaskRegistryForTests,
isParentFlowLinkError,
setTaskRegistryControlRuntimeForTests,
setTaskRegistryDeliveryRuntimeForTests,
setTaskCleanupAfterById,
setTaskRunDeliveryStatusByRunId,
updateTaskNotifyPolicyById,
} from "./task-registry.js";
export type { TaskRecord } from "./task-registry.types.js";