MCPcopy
hub / github.com/wavetermdev/waveterm / WaitForToolApproval

Function WaitForToolApproval

pkg/aiusechat/toolapproval.go:98–119  ·  view source on GitHub ↗
(ctx context.Context, toolCallId string)

Source from the content-addressed store, hash-verified

96}
97
98func WaitForToolApproval(ctx context.Context, toolCallId string) (string, error) {
99 req, exists := getToolApprovalRequest(toolCallId)
100 if !exists {
101 return "", nil
102 }
103
104 select {
105 case <-ctx.Done():
106 return "", ctx.Err()
107 case <-req.doneChan:
108 }
109
110 req.mu.Lock()
111 approval := req.approval
112 req.mu.Unlock()
113
114 globalApprovalRegistry.mu.Lock()
115 delete(globalApprovalRegistry.requests, toolCallId)
116 globalApprovalRegistry.mu.Unlock()
117
118 return approval, nil
119}

Callers 1

processToolCallInternalFunction · 0.85

Calls 2

getToolApprovalRequestFunction · 0.85
ErrMethod · 0.80

Tested by

no test coverage detected