MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / finalizeQueueState

Function finalizeQueueState

cli/src/hooks/helpers/send-message.ts:86–108  ·  view source on GitHub ↗
(params: FinalizeQueueStateParams)

Source from the content-addressed store, hash-verified

84}
85
86export const finalizeQueueState = (params: FinalizeQueueStateParams): void => {
87 const {
88 setStreamStatus,
89 setCanProcessQueue,
90 updateChainInProgress,
91 isProcessingQueueRef,
92 isQueuePausedRef,
93 resumeQueue,
94 } = params
95
96 setStreamStatus('idle')
97 // Release lock here as part of normal completion flow.
98 // Also released in finally block and .catch() as safety nets (idempotent).
99 if (isProcessingQueueRef) {
100 isProcessingQueueRef.current = false
101 }
102 if (resumeQueue) {
103 resumeQueue()
104 } else {
105 setCanProcessQueue(!isQueuePausedRef?.current)
106 }
107 updateChainInProgress(false)
108}
109
110const DEFAULT_RUN_OUTPUT_ERROR_MESSAGE = 'No output from agent run'
111

Callers 4

finalizeAfterErrorFunction · 0.85
handleRunCompletionFunction · 0.85
handleRunErrorFunction · 0.85

Calls 3

setStreamStatusFunction · 0.85
setCanProcessQueueFunction · 0.85
updateChainInProgressFunction · 0.85

Tested by

no test coverage detected