Commit a6e51ce
committed
codemode: fix Start() fail-fast and use tools.As for wrapper unwrapping
Start() returned on the first error, so one broken toolset (e.g. an
unreachable MCP server) prevented all remaining toolsets from starting.
Collect all errors with errors.Join, matching the existing Stop()
behavior.
Both Start() and Stop() used a direct type assertion to find Startable,
which cannot see through wrapper chains (e.g. StartableToolSet). Switch
to tools.As so the capability is discovered at any depth.
Extract the now-identical loops into a shared forEachStartable helper to
remove the duplication.
Assisted-By: docker-agent1 parent c45c010 commit a6e51ce
2 files changed
+45
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
| 106 | + | |
115 | 107 | | |
116 | 108 | | |
117 | 109 | | |
118 | | - | |
| 110 | + | |
| 111 | + | |
119 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
120 | 117 | | |
121 | | - | |
122 | | - | |
| 118 | + | |
| 119 | + | |
123 | 120 | | |
124 | 121 | | |
125 | 122 | | |
126 | 123 | | |
127 | | - | |
128 | 124 | | |
129 | 125 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
190 | 221 | | |
191 | | - | |
192 | | - | |
193 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
194 | 226 | | |
195 | 227 | | |
196 | 228 | | |
| |||
205 | 237 | | |
206 | 238 | | |
207 | 239 | | |
208 | | - | |
| 240 | + | |
209 | 241 | | |
210 | 242 | | |
211 | 243 | | |
| |||
0 commit comments