vexp-mcp 3.1.2 → 3.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/daemon-client.js +45 -2
- package/package.json +1 -1
package/dist/daemon-client.js
CHANGED
|
@@ -320,6 +320,48 @@ export class DaemonClient {
|
|
|
320
320
|
});
|
|
321
321
|
});
|
|
322
322
|
}
|
|
323
|
+
/**
|
|
324
|
+
* How long one call waits for the daemon, per tool.
|
|
325
|
+
*
|
|
326
|
+
* This was 30 s for every tool. verify_done does not fit it: on a field
|
|
327
|
+
* ledger of 26 calls (2026-09-09, a 229-file repo on a 9p mount) the median
|
|
328
|
+
* was 28.4 s and 12 ran past 30 s; both agent-initiated calls timed out here
|
|
329
|
+
* while the daemon finished the work (52 s, 42 s) and cached a verdict nobody
|
|
330
|
+
* read. The daemon never cancels on a client that stopped waiting, so a
|
|
331
|
+
* short budget only turns finished work into an error. Lockstep twin:
|
|
332
|
+
* `daemon_call_budget` in packages/vexp-core/src/mcp_stdio.rs (the test
|
|
333
|
+
* reads that file).
|
|
334
|
+
*/
|
|
335
|
+
static callBudgetMs(tool) {
|
|
336
|
+
switch (tool) {
|
|
337
|
+
case "verify_done":
|
|
338
|
+
return 120_000;
|
|
339
|
+
case "run_pipeline":
|
|
340
|
+
case "get_context_capsule":
|
|
341
|
+
return 90_000;
|
|
342
|
+
default:
|
|
343
|
+
return 30_000;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* What the agent reads when the budget runs out: the tool, that the daemon
|
|
348
|
+
* accepted the request and is still working on it, and for verify_done the
|
|
349
|
+
* one useful move — the finished verdict is memoized on the tree
|
|
350
|
+
* fingerprint, so one more call after the daemon is done returns instantly.
|
|
351
|
+
*/
|
|
352
|
+
static timeoutMessage(tool, budgetMs) {
|
|
353
|
+
let m = `Timeout: no response from daemon for tool '${tool}' after ${Math.round(budgetMs / 1000)}s. ` +
|
|
354
|
+
"The daemon accepted the request and keeps processing it (a client that stops waiting does not cancel it)";
|
|
355
|
+
if (tool === "verify_done") {
|
|
356
|
+
m +=
|
|
357
|
+
"; call verify_done once more in ~30s: a finished verdict on an unchanged tree is served " +
|
|
358
|
+
"from cache instantly. Phase timings for the slow call are in .vexp/daemon.log (grep verify_done).";
|
|
359
|
+
}
|
|
360
|
+
else {
|
|
361
|
+
m += ".";
|
|
362
|
+
}
|
|
363
|
+
return m;
|
|
364
|
+
}
|
|
323
365
|
async callOnce(tool, params) {
|
|
324
366
|
return new Promise((resolve, reject) => {
|
|
325
367
|
const id = ++this.requestCounter;
|
|
@@ -328,13 +370,14 @@ export class DaemonClient {
|
|
|
328
370
|
let client;
|
|
329
371
|
let responseBuffer = "";
|
|
330
372
|
let settled = false;
|
|
373
|
+
const budgetMs = DaemonClient.callBudgetMs(tool);
|
|
331
374
|
const timeout = setTimeout(() => {
|
|
332
375
|
if (!settled) {
|
|
333
376
|
settled = true;
|
|
334
377
|
client?.destroy();
|
|
335
|
-
reject(new Error(
|
|
378
|
+
reject(new Error(DaemonClient.timeoutMessage(tool, budgetMs)));
|
|
336
379
|
}
|
|
337
|
-
},
|
|
380
|
+
}, budgetMs);
|
|
338
381
|
const settle = (fn) => {
|
|
339
382
|
if (!settled) {
|
|
340
383
|
settled = true;
|