MCPcopy Create free account
hub / github.com/xerrors/Yuxi / processApprovalInStream

Function processApprovalInStream

web/src/composables/useApproval.js:59–78  ·  view source on GitHub ↗
(chunk, threadId, currentAgentId)

Source from the content-addressed store, hash-verified

57 }
58
59 const processApprovalInStream = (chunk, threadId, currentAgentId) => {
60 if (!APPROVAL_REQUIRED_STATUSES.has(chunk.status)) {
61 return false
62 }
63
64 const threadState = getThreadState(threadId)
65 if (!threadState) return false
66
67 const pendingInterrupt = extractPendingInterrupt(chunk, threadId)
68 if (!pendingInterrupt) return false
69
70 threadState.isStreaming = false
71 threadState.pendingInterrupt = pendingInterrupt
72
73 applyInterruptToApprovalState(pendingInterrupt, threadId)
74
75 fetchThreadMessages({ agentId: currentAgentId, threadId })
76
77 return true
78 }
79
80 const restoreInterruptFromThreadState = (threadId) => {
81 const threadState = getThreadState(threadId)

Callers 1

handleStreamChunkFunction · 0.85

Calls 3

getThreadStateFunction · 0.85
extractPendingInterruptFunction · 0.85

Tested by

no test coverage detected