(tc coretools.ToolCall)
| 88 | } |
| 89 | } |
| 90 | |
| 91 | func (e *StreamingToolExecutor) AddTool(tc coretools.ToolCall) bool { |
| 92 | e.mu.Lock() |
| 93 | slot := &ToolSlot{TC: tc, State: ToolStateQueued, abort: make(chan struct{}), done: make(chan struct{})} |
| 94 | e.slots[tc.ID] = slot |
| 95 | e.toolOrder = append(e.toolOrder, tc.ID) |
| 96 | canStart := e.canStartImmediatelyLocked(tc, false) |
| 97 | e.mu.Unlock() |
| 98 | if canStart { |
| 99 | e.launch(tc.ID) |
| 100 | return true |
| 101 | } |
| 102 | return false |
| 103 | } |
| 104 | |
| 105 | func (e *StreamingToolExecutor) TryStartQueued(tcID string) bool { |