Skip to content

Commit 3c32607

Browse files
cliffhallclaude
andcommitted
test(memory): accept either EISDIR message form, whatever the platform
The persistence test keyed the expected EISDIR message on the Node major, expecting the file path appended on Node >= 26. Whether Node appends it depends on the platform, not the version: Node 26 on Linux appends it, while every Node on macOS (26.7.0 included) gives the bare text, so the gate failed on a Mac. Accept exactly the bare text or the bare text followed by the quoted path. The server passes Node's message through unchanged and needs no change. Closes modelcontextprotocol#5162 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: cliffhall <[email protected]>
1 parent 56e4c4e commit 3c32607

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎src/memory/__tests__/persistence.test.ts‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,12 @@ describe("memory persistence over the protocol", () => {
211211
// which is not the ENOENT that means "no graph yet".
212212
await fs.mkdir(filePath);
213213
const { client } = await open();
214-
// Node 26 appends the path to the message; earlier versions do not
215-
// (#5076). The server passes Node's message through either way.
214+
// Whether Node appends the path to the message depends on the platform,
215+
// not the Node version: Node 26 on Linux appends it, while every Node
216+
// on macOS gives the bare text (#5076, #5162). The server passes Node's
217+
// message through unchanged, so accept exactly either form.
216218
const bare = "EISDIR: illegal operation on a directory, read";
217-
const nodeMajor = Number(process.versions.node.split(".")[0]);
218-
const expected = nodeMajor >= 26 ? `${bare} '${filePath}'` : bare;
219+
const expected = [bare, `${bare} '${filePath}'`];
219220

220221
for (const [name, args] of [
221222
["read_graph", {}],
@@ -225,7 +226,7 @@ describe("memory persistence over the protocol", () => {
225226
] as const) {
226227
const result = await call(client, name, args);
227228
expect(result.isError).toBe(true);
228-
expect(textOf(result)).toBe(expected);
229+
expect(expected).toContain(textOf(result));
229230
}
230231
await expect(
231232
client.readResource({ uri: "memory://knowledge-graph" }),

0 commit comments

Comments
 (0)