Commit a088a03
committed
fix(v1.46.1): remove bogus 3s TESTIMIZE UNHEALTHY grace window
The 3-second grace in GenerationAgent was based on a wrong assumption
about how fast the Copilot CLI's MCP client handshakes with a server.
In reality it takes ~60s to attempt + time out an initialize against
a non-spec-compliant server (JSON-RPC error -32001). Our grace fired
well before the real SessionMcpServersLoadedEvent came through,
producing a false UNHEALTHY line. Then the real event arrived ~60s
later with status=Failed and the actual error message.
Fix: trust the SDK event entirely. When it fires (success or failure),
log the real status with the real error. Session creation is
non-blocking with respect to MCP loading, so generation starts
immediately and the MCP handshake runs in parallel.
## Separate fix (Testimize.MCP.Server, not this repo)
The underlying reason the CLI's -32001 timeout fires at all: testimize
was emitting responses with both "result":{...} AND "error":null,
which is a JSON-RPC 2.0 spec violation. Strict MCP clients reject
malformed responses and wait forever for a valid one. Updated
testimize's Program.cs to serialize only the applicable field per
spec (requires rebuild + reinstall of testimize-mcp 1.1.10).
## Expected debug log after both fixes
[generate] TESTIMIZE CONFIGURED server=testimize command=testimize-mcp ...
[generate] TESTIMIZE LOADED server=testimize status=Connected source=...
[generate] TESTIMIZE DISPOSED (session closed)
No more false UNHEALTHY line. LOADED fires with Connected instead of
Failed once testimize-mcp's JSON-RPC output is spec-compliant.
Tests: 1647/1647.1 parent 8c6226c commit a088a03
File tree
3 files changed
+21
-27
lines changed- src/Spectra.CLI/Agent/Copilot
3 files changed
+21
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
8 | 18 | | |
9 | 19 | | |
10 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| 212 | + | |
212 | 213 | | |
213 | 214 | | |
214 | 215 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | 144 | | |
149 | 145 | | |
150 | 146 | | |
| |||
168 | 164 | | |
169 | 165 | | |
170 | 166 | | |
171 | | - | |
172 | 167 | | |
173 | 168 | | |
174 | 169 | | |
| |||
184 | 179 | | |
185 | 180 | | |
186 | 181 | | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | 182 | | |
192 | 183 | | |
193 | 184 | | |
| |||
218 | 209 | | |
219 | 210 | | |
220 | 211 | | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
239 | 222 | | |
240 | 223 | | |
241 | 224 | | |
| |||
0 commit comments