MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / GetRemainingResults

Method GetRemainingResults

agent/tools_executor.go:196–226  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

194func (e *StreamingToolExecutor) WaitForActivity(ctx context.Context) {
195 if !e.HasPendingWork() {
196 return
197 }
198 if !e.hasRunningWork() {
199 e.maybeDrain()
200 if !e.hasRunningWork() {
201 return
202 }
203 }
204 select {
205 case <-ctx.Done():
206 case <-e.activity:
207 case <-e.cancelCtx.Done():
208 }
209}
210
211func (e *StreamingToolExecutor) GetRemainingResults(ctx context.Context) []map[string]any {
212 for e.HasPendingWork() {
213 if ctx != nil && ctx.Err() != nil {
214 break
215 }
216 if e.Cancelled() && !e.hasRunningWork() {
217 break
218 }
219 e.WaitForActivity(ctx)
220 e.maybeDrain()
221 if !e.hasRunningWork() {
222 break
223 }
224 }
225 e.mu.Lock()
226 defer e.mu.Unlock()
227 var results []map[string]any
228 for _, tid := range e.toolOrder {
229 slot := e.slots[tid]

Calls 6

HasPendingWorkMethod · 0.95
CancelledMethod · 0.95
hasRunningWorkMethod · 0.95
WaitForActivityMethod · 0.95
maybeDrainMethod · 0.95