Commit daf3c88
fix(mcp): address Bugbot findings on PR #19
Medium: insights.html onToolResult race
The initialized flag was set to true BEFORE the try-catch in
onToolResult. If parseToolResult threw or returned null, the flag was
already set and the setTimeout fallback (which uses the more robust
load() path) never fired — the UI locked on the loading spinner with
no recovery. Now the flag only flips after a successful render.
Low: consolidate addToolWithMeta to delegate
addToolWithMeta and addToolWithMetaTyped had ~25 lines of identical
rate-limiting + audit-logging + tool-filtering wrapper. Any future fix
would need to land in both places. Collapsed to a 1-line shim that
calls the typed variant with struct{}, so the wrapper exists once.
Call sites unchanged (s.addToolWithMeta still works).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent f4da3c5 commit daf3c88
2 files changed
Lines changed: 13 additions & 42 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
128 | | - | |
129 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
130 | 130 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
| 131 | + | |
168 | 132 | | |
169 | 133 | | |
170 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
407 | | - | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
408 | 412 | | |
409 | 413 | | |
410 | | - | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
411 | 418 | | |
412 | 419 | | |
413 | 420 | | |
| |||
0 commit comments