Files
reverse-engineering-anything/src/process/OwnedMcpClient.ts
T
morluto e68e548a3d fix(cli): validate plist and dylib-root options with their contract fields (#10557)
* fix(cli): validate plist and dylib-root options with their contract fields

inspect-plist --relative-path and trace-dylib-resolution --root were
declared as bare strings on the CLI. --schema under-advertised them, and an
empty or NUL value reached the operation contract, whose refusal named the
contract field (path, roots) instead of the CLI option.

Declare both options with the contract's own field schemas
(localPathStringSchema; dylibResolutionInputSchema.shape.roots), so the CLI
refuses them first and names --relative-path or --root.

Fixes #9764
Fixes #9823

* fix(mcp): observe SDK initiated cleanup failures
2026-11-14 14:50:59 -05:00

13 lines
490 B
TypeScript

import { Client } from "@modelcontextprotocol/client";
/** Observe SDK-initiated close failures while keeping them available to callers. */
export class OwnedMcpClient extends Client {
override close(): Promise<void> {
const closing = super.close();
// The SDK starts close without awaiting it after a legacy handshake fails.
// The transport owner still receives the original failure when it joins cleanup.
void closing.catch(() => undefined);
return closing;
}
}