Repository navigation
Conversation
save() 首行的 memoryRevision.isBlank() 在没有记忆文件时恒为真:snapshot() 返回 null, revision 落成空串,于是保存流程连取锁都没走到 —— 既无 toast 也无日志,真机表现就是 「助手编辑页改完提示词点保存,按钮可点但毫无反应,退出重进内容丢失」。 人格提示词存在 index.json,与 MEMORY.md 无关,不该被记忆 revision 锁死: - 门禁只保留 dirty / saving / 记忆超限三条 - 记忆未改动时不触碰记忆存储 - 记忆改动但 revision 为空时走 replaceAll(content) 无并发校验写入 - save 入口 / 成功 / 失败各补一条日志,失败不再静默
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
save() 首行的 memoryRevision.isBlank() 在没有记忆文件时恒为真:snapshot() 返回 null, revision 落成空串,于是保存流程连取锁都没走到 —— 既无 toast 也无日志,表现为 「助手编辑页改完提示词点保存,按钮可点但毫无反应,退出重进内容丢失」。
根因
fun save() {
if (!dirty || saving || memoryOverLimit || memoryRevision.isBlank()) return
memoryRevision 只在 LaunchedEffect 里由 AgentMemoryRepository.snapshot(assistantId) 赋值。
没有 MEMORY.md 时 snapshot() 返回 null,runCatching 吞掉后 revision 落成空串 → 保存流程
在第一行就 return,连存储层的锁都没走到。人格提示词存在 eta-assistants/index.json,
与 MEMORY.md 是两套存储,不该被记忆 revision 锁死。
改动
验证
日志可见 assistant-save start/ok