memory: README does not say that unreadable lines are skipped, kept on every write, and fixable only by hand
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 90/100
- Issue 类型
- 文档
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
结合阅读 src/memory/README.md、src/memory/index.ts 中的 loadGraphWithUnreadable 和 saveGraph,以确认文档所述行为。在存储或故障排除部分附近添加一段简短说明,涵盖被跳过和记录日志的行、写入时的保留行为和字节限制、工具的局限性以及手动修复。README 解释了所述行为和恢复步骤后,即为完成。
由索引模型根据 Issue 内容生成。
描述
Which server?
memory (@modelcontextprotocol/server-memory), src/memory/README.md.
The problem
The README does not say what the server does with a line of the memory file it cannot read, or how to fix one. The only mention is in passing, under the write limits ("MEMORY_MAX_FILE_BYTES counts the bytes of the file as it would be saved, unreadable lines included").
What the server does today (loadGraphWithUnreadable and saveGraph in src/memory/index.ts, from #4885):
- A line that is not JSON, is not an object, has an unknown
type, or fails the entity or relation schema (an entity with noentityType, an observation that is not a string, a relation with norelationType) is left out of the graph. Each skipped line is logged to stderr ("Skipping invalid entity in memory file: …"). - Every save writes those lines back unchanged, after the graph's own lines, so a write never drops data it could not read.
- No tool can then remove or repair such a line.
read_graph,search_nodesandopen_nodesdo not show it;delete_entitiesanddelete_observationsreport its name as not found;add_observationsandcreate_relationsfail with "Entity with name … not found";create_entitiesunder the same name stores a second record beside the invalid line; an invalid relation matches nodelete_relationscall and stays after the entities it names are deleted. #5541 pins this insrc/memory/__tests__/invalid-record-removal.test.ts.
So the only remedy is to edit the file by hand, and a user who sees the stderr line, or a Not found for an entity they can see in the file, has nowhere to read that.
Expected
A short passage in the README (near the storage or troubleshooting sections) stating: which lines are skipped, that they are logged to stderr, that they are kept in the file on every write and count toward MEMORY_MAX_FILE_BYTES, that no tool reaches them, and that the fix is to stop the clients using the file and correct or delete the line in a text editor.
Scope
Documentation only. Whether a remediation tool should exist is a separate question this issue does not ask.
Found while verifying #5541.
- 主要语言
- TypeScript
- 星标
- 92k
- 派生
- 12k
- 平均合并
- 3 小时 46 分钟
- 30 天内合并 PR
- 206
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
modelcontextprotocol/servers 的其他 Issue
-
`interface-diff` discards the git error when resolving its default base and reports the wrong cause未关闭
难度 2/5 1-3 小时 新手友好度 82/100
modelcontextprotocol/servers#5636 ·
维护者通常 1 天内回复
-
chore server-memory v2
难度 2/5 1-3 小时 新手友好度 76/100
modelcontextprotocol/servers#5634 ·
维护者通常 1 天内回复
-
bug server-memory v2
难度 4/5 3-5 天 新手友好度 48/100
modelcontextprotocol/servers#5635 · 1 条评论 ·
维护者通常 1 天内回复
-
bug server-memory v2
难度 5/5 一周以上 新手友好度 42/100
modelcontextprotocol/servers#5624 ·
维护者通常 1 天内回复
-
enhancement v2
难度 4/5 3-5 天 新手友好度 48/100
modelcontextprotocol/servers#5611 ·
维护者通常 1 天内回复
查看 modelcontextprotocol/servers 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 79/100
hurttlocker/o8#6535 ·
-
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复
-
area: backend bug priority: low
难度 2/5 1-3 小时 新手友好度 92/100
snapotter-hq/SnapOtter#4856 ·
维护者通常 1 天内回复
-
bug follow-up
难度 1/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
spellshift/realm#2509 ·
维护者通常 1 天内回复