Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

memory: persistence EISDIR test fails on Node 26.7 (the path suffix depends on the Node minor, not the major)

未关闭 适合新手
#5,162 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@ace-ify 已经在做这个了。

开始于 2026年10月19日。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
83/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
领域
testing

调研方向

阅读 src/memory/__tests__/persistence.test.ts,尤其是测试 "reports a graph file that cannot be read as a tool error",以及 #5076 引入的基于版本的预期。运行 npm test -w src/memory -- __tests__/persistence.test.ts,在 Node 26.7 上重现该失败。更新断言,使其接受单独的 EISDIR 消息,或后接文件路径的该消息,然后确认测试通过。

由索引模型根据 Issue 内容生成。

描述

bug server-memory v2

Problem

src/memory/__tests__/persistence.test.ts, "reports a graph file that cannot be read as a tool error", fails again locally, this time on Node 26.7.0 (macOS), so npm run local:gate exits 1 on a machine whose default Node is 26.7:

Expected: "EISDIR: illegal operation on a directory, read '/var/folders/.../memory.jsonl'"
Received: "EISDIR: illegal operation on a directory, read"

#5076 made the expectation follow the Node major: the path appended on >= 26, the bare message before. That matched the Node 26 release #5076 was filed against, but Node 26.7.0 no longer appends the path:

$ node -v && node -e 'require("fs").promises.readFile("/tmp").catch(e=>console.log(e.message))'
v26.7.0
EISDIR: illegal operation on a directory, read

CI's Node 26 leg (#5068) passes on v2/main, so the format differs by Node minor (or platform), not by major. The server is correct on every version: it returns an isError result carrying Node's message. Only the test's expectation is wrong.

Found while running the gate for #5161, on v2/main at 38569bd5.

Reproduce

On Node 26.7.0, on v2/main:

npm ci
npm test -w src/memory -- __tests__/persistence.test.ts

1 failed. Passes on Node 22.

Change

Stop keying the expectation on the Node version. Assert the message is exactly the bare text, or the bare text followed by '<filePath>': for example expect([bare, \${bare} '${filePath}'`]).toContain(textOf(result))`. That still pins the full text the client receives, and holds whichever form the running Node produces.

主要语言
TypeScript
星标
91.4k
派生
11.8k
平均合并
7 小时 36 分钟
30 天内合并 PR
126

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

modelcontextprotocol/servers 的其他 Issue

查看 modelcontextprotocol/servers 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。