(chunk, threadId, currentAgentId)
| 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) |
no test coverage detected