()
| 149 | * 清除已完成的工具记录 |
| 150 | */ |
| 151 | const clearCompletedTools = () => { |
| 152 | for (const [id, tool] of toolRuns.value) { |
| 153 | if (tool.state === "completed" || tool.state === "failed" || tool.state === "cancelled") { |
| 154 | toolRuns.value.delete(id); |
| 155 | } |
| 156 | } |
| 157 | }; |
| 158 | |
| 159 | // ================== |
| 160 | // Return |