Repository navigation
fix(memory): API 不可用时不静默写入 fallback 伪摘要 (#114 补丁) - #116
Merged
Merged
Conversation
原代码用 runCatching 吞掉所有 API 异常并回退 fallback,导致无网/key 错误/服务不可达时把对话原文拼接冒充 AI 摘要存入长期记忆并清空原对话, 用户无感知且污染后续上下文。改为向上抛出,由 archiveCurrentConversation ToMemory 的 catch 提示记忆生成失败并保留对话。 Co-Authored-By: Claude <noreply@anthropic.com>
Collaborator
Author
|
补丁已红米 K50 离线实测:API 不可用时不再静默存 fallback 伪摘要,改为提示失败并保留对话。建议先合 #114 再合本 PR,冲突会自动消化。 |
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.
#114 补丁。
问题:API 不可用(无网 / key 错 / URL 不通 / 宕机 / 限流)时,
summarizeConversationToMemory用runCatching吞掉异常回退 fallback,把"对话原文拼接"冒充 AI 摘要存入长期记忆并清空原对话,用户无感知,且伪摘要会污染后续上下文。修复:移除首个
runCatching的 fallback 吞噬,API 异常向上抛出,由archiveCurrentConversationToMemory的 catch 提示"记忆生成失败:xxx。当前对话已保留。"——不落库、不清空。仅改一处,4 增 5 减。实体机离线实测(同一份 5 条对话):
|拼接)[]被清空