Commit 509643b
committed
fix: avoid triggering toolset startup from emitToolsChanged callback
emitToolsChanged uses a 5-second timeout context that races with slow
toolset initialization (e.g. RAG file indexing). When an MCP server
connects and fires OnToolsChanged before RAG finishes, the timeout
causes a context deadline exceeded error and a spurious warning.
Add Agent.StartedTools() that lists tools only from already-started
toolsets without calling ensureToolSetsAreStarted(), and use it in
emitToolsChanged so the callback never triggers initialization.
Assisted-By: docker-agent1 parent dc8062b commit 509643b
2 files changed
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
212 | 222 | | |
| 223 | + | |
| 224 | + | |
213 | 225 | | |
214 | 226 | | |
215 | 227 | | |
216 | | - | |
| 228 | + | |
217 | 229 | | |
218 | 230 | | |
219 | 231 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
808 | 808 | | |
809 | 809 | | |
810 | 810 | | |
811 | | - | |
| 811 | + | |
| 812 | + | |
812 | 813 | | |
813 | 814 | | |
814 | 815 | | |
| |||
0 commit comments