vexp-mcp 3.1.2 → 3.2.0

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.
@@ -131,6 +131,12 @@ export class DaemonClient {
131
131
  // unrelated cwd / a stripped env (e.g. the detached HTTP supervisor).
132
132
  const env = binaryEnvFor(binary);
133
133
  env.VEXP_WORKSPACE = workspaceRoot;
134
+ // `detached` stays (DETACHED_PROCESS on Windows): a non-detached child
135
+ // would sit in libuv's kill-on-close job object and go down with this
136
+ // server. The daemon this starts has no console either; its git
137
+ // children carry CREATE_NO_WINDOW themselves (vexp-core proc.rs), so
138
+ // nothing here opens a terminal window. `windowsHide` is ignored next
139
+ // to DETACHED_PROCESS and is deliberately absent.
134
140
  const child = spawn(binary, ["daemon-cmd", "start"], {
135
141
  cwd: workspaceRoot,
136
142
  stdio: "ignore",
@@ -320,6 +326,48 @@ export class DaemonClient {
320
326
  });
321
327
  });
322
328
  }
329
+ /**
330
+ * How long one call waits for the daemon, per tool.
331
+ *
332
+ * This was 30 s for every tool. verify_done does not fit it: on a field
333
+ * ledger of 26 calls (2026-09-09, a 229-file repo on a 9p mount) the median
334
+ * was 28.4 s and 12 ran past 30 s; both agent-initiated calls timed out here
335
+ * while the daemon finished the work (52 s, 42 s) and cached a verdict nobody
336
+ * read. The daemon never cancels on a client that stopped waiting, so a
337
+ * short budget only turns finished work into an error. Lockstep twin:
338
+ * `daemon_call_budget` in packages/vexp-core/src/mcp_stdio.rs (the test
339
+ * reads that file).
340
+ */
341
+ static callBudgetMs(tool) {
342
+ switch (tool) {
343
+ case "verify_done":
344
+ return 120_000;
345
+ case "run_pipeline":
346
+ case "get_context_capsule":
347
+ return 90_000;
348
+ default:
349
+ return 30_000;
350
+ }
351
+ }
352
+ /**
353
+ * What the agent reads when the budget runs out: the tool, that the daemon
354
+ * accepted the request and is still working on it, and for verify_done the
355
+ * one useful move — the finished verdict is memoized on the tree
356
+ * fingerprint, so one more call after the daemon is done returns instantly.
357
+ */
358
+ static timeoutMessage(tool, budgetMs) {
359
+ let m = `Timeout: no response from daemon for tool '${tool}' after ${Math.round(budgetMs / 1000)}s. ` +
360
+ "The daemon accepted the request and keeps processing it (a client that stops waiting does not cancel it)";
361
+ if (tool === "verify_done") {
362
+ m +=
363
+ "; call verify_done once more in ~30s: a finished verdict on an unchanged tree is served " +
364
+ "from cache instantly. Phase timings for the slow call are in .vexp/daemon.log (grep verify_done).";
365
+ }
366
+ else {
367
+ m += ".";
368
+ }
369
+ return m;
370
+ }
323
371
  async callOnce(tool, params) {
324
372
  return new Promise((resolve, reject) => {
325
373
  const id = ++this.requestCounter;
@@ -328,13 +376,14 @@ export class DaemonClient {
328
376
  let client;
329
377
  let responseBuffer = "";
330
378
  let settled = false;
379
+ const budgetMs = DaemonClient.callBudgetMs(tool);
331
380
  const timeout = setTimeout(() => {
332
381
  if (!settled) {
333
382
  settled = true;
334
383
  client?.destroy();
335
- reject(new Error(`Timeout: no response from daemon for tool '${tool}' after 30s`));
384
+ reject(new Error(DaemonClient.timeoutMessage(tool, budgetMs)));
336
385
  }
337
- }, 30_000);
386
+ }, budgetMs);
338
387
  const settle = (fn) => {
339
388
  if (!settled) {
340
389
  settled = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vexp-mcp",
3
- "version": "3.1.2",
3
+ "version": "3.2.0",
4
4
  "license": "UNLICENSED",
5
5
  "description": "vexp MCP server — AI context tools for coding agents",
6
6
  "type": "module",