(ctx context.Context)
| 177 | } |
| 178 | } |
| 179 | } |
| 180 | return results |
| 181 | } |
| 182 | |
| 183 | func (e *StreamingToolExecutor) HasPendingWork() bool { |
| 184 | e.mu.Lock() |
| 185 | defer e.mu.Unlock() |
| 186 | for _, slot := range e.slots { |
| 187 | if slot.State == ToolStateQueued || slot.State == ToolStateExecuting { |
| 188 | return true |
| 189 | } |
| 190 | } |
| 191 | return false |
| 192 | } |
| 193 | |
| 194 | func (e *StreamingToolExecutor) WaitForActivity(ctx context.Context) { |
| 195 | if !e.HasPendingWork() { |
| 196 | return |
| 197 | } |