MCPcopy Create free account
hub / github.com/Work-Fisher/code-claw / loadRuntimeQueueState

Function loadRuntimeQueueState

tools/claw-launcher-ui/server.mjs:1112–1135  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1110}
1111
1112async function loadRuntimeQueueState() {
1113 await ensureDirs()
1114 if (!(await fileExists(runtimeStatePath))) {
1115 return
1116 }
1117
1118 try {
1119 const payload = JSON.parse(await readFile(runtimeStatePath, 'utf8'))
1120 const queue = Array.isArray(payload?.queue)
1121 ? payload.queue.map(hydrateRunRequest).filter(Boolean)
1122 : []
1123 const pendingApproval = hydrateRunRequest(payload?.pendingApproval)
1124
1125 runQueue.splice(0, runQueue.length, ...queue)
1126 pendingApprovalRequest = pendingApproval
1127 syncQueuedState()
1128 } catch (error) {
1129 pushLog(
1130 'ui',
1131 `Failed to load runtime queue state: ${error instanceof Error ? error.message : String(error)}`,
1132 'warn',
1133 )
1134 }
1135}
1136
1137async function repairInterruptedRuns() {
1138 const records = await readAppSessionsStore()

Callers 1

mainFunction · 0.85

Calls 7

ensureDirsFunction · 0.85
fileExistsFunction · 0.85
readFileFunction · 0.85
hydrateRunRequestFunction · 0.85
syncQueuedStateFunction · 0.85
pushLogFunction · 0.85
parseMethod · 0.45

Tested by

no test coverage detected