@modelcontextprotocol/inspector 2.3.0 → 2.4.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.
@@ -67,10 +67,12 @@ async function run() {
67
67
  // rather than throwing "handleError is not a function" over it.
68
68
  if (typeof handleError !== "function")
69
69
  throw err;
70
- // write-then-exit like the direct bin; the envelope is a few hundred bytes,
71
- // well inside the pipe buffer, so the truncation risk noted above (which is
72
- // about a large stdout payload) doesn't apply to this stderr line.
73
- handleError(err); // writes the envelope + process.exit(code); never returns
70
+ // Write-then-exit like the direct bin — and AWAIT it. The envelope being
71
+ // a few hundred bytes is not the safeguard it looks like: on a pipe the
72
+ // write is asynchronous, so `process.exit()` discards it whether or not
73
+ // it would have fitted in the buffer. `handleError` settles on the write
74
+ // callback before exiting; skipping the await puts the truncation back.
75
+ await handleError(err); // writes the envelope + process.exit(code)
74
76
  }
75
77
  }
76
78
  else {