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

Function pumpRunQueue

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

Source from the content-addressed store, hash-verified

3249}
3250
3251async function pumpRunQueue() {
3252 if (
3253 state.run.status === 'running' ||
3254 persistentHost?.activeTurn ||
3255 (clawChild && clawChild.exitCode === null) ||
3256 pendingApprovalRequest
3257 ) {
3258 syncQueuedState()
3259 updateState(draft => {
3260 draft.run.queue = state.run.queue
3261 draft.run.pendingApproval = state.run.pendingApproval
3262 })
3263 return
3264 }
3265
3266 const next = runQueue.shift()
3267 syncQueuedState()
3268 persistRuntimeQueueStateSoon()
3269 updateState(draft => {
3270 draft.run.queue = state.run.queue
3271 draft.run.pendingApproval = state.run.pendingApproval
3272 })
3273
3274 if (!next) {
3275 return
3276 }
3277
3278 if (next.approval) {
3279 await markPendingApproval(next)
3280 return
3281 }
3282
3283 await executeRunRequest(next)
3284}
3285
3286async function approvePendingRun() {
3287 if (!pendingApprovalRequest) {

Callers 4

finalizeClawRunFunction · 0.85
rejectPendingRunFunction · 0.85
server.mjsFile · 0.85

Calls 5

syncQueuedStateFunction · 0.85
updateStateFunction · 0.85
markPendingApprovalFunction · 0.85
executeRunRequestFunction · 0.85

Tested by

no test coverage detected