You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason will be displayed to describe this comment to others. Learn more.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
slow-stack/mneme issue 799:该问题涉及 main 面板未传递 session ID;本次变更只为手动合成路由增加会话缓存查找和传递。
Merge Risk: Minimal · up to 431a3
This change passes the selected session to manual diary composition, removes the unreachable project-level auto trigger, and stops a missing inbox from advancing lastDate. No actionable merge risk remains. Merge order relative to the other changelog-touching PRs needs to be coordinated.
Reviewing files that changed from the base of the PR and between 3fb478c and f286ad7.
Files selected for processing: 9
dsh-mneme/CHANGELOG.md
dsh-mneme/lib/api.js
dsh-mneme/lib/diary/auto.js
dsh-mneme/lib/diary/compose.js
dsh-mneme/src/api.js
dsh-mneme/src/diary/auto.js
dsh-mneme/src/diary/compose.js
dsh-mneme/test/api.test.js
dsh-mneme/test/diary.test.js
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Reviewing files that changed from the base of the PR and between f286ad7 and 431a3aa.
Files selected for processing: 4
dsh-mneme/CHANGELOG.md
dsh-mneme/lib/diary/compose.js
dsh-mneme/src/diary/compose.js
dsh-mneme/test/issue-795-lastdate.test.js
Files skipped from review as they are similar to previous changes: 1
dsh-mneme/CHANGELOG.md
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.
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
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.
这个 PR 修什么
手动「写今天」从来没拿到过会话,项目维度的日记从 0.16.0 起就没再写过一次。
报告者(#795)在 0.17.2 / Windows 桌面端实测:
runs.jsonl最后一次written是 11-15 10:47:54(0.15.2 装完 3 分钟),之后 0 篇正文。rollover—— 不是没人用,是触发没送到。{"trigger":"manual","status":"skipped","reason":"no-inbox-dir"},界面只显示「这一轮没有写成。」no-material+ N 条already-written,agents/standard/下没有任何.md。两处断点,都在「看起来在跑」的状态下静默失效。
根因
一、手动路径把会话丢了
src/api.js的手动路由(原:4086-4102)拿到?session=只用来反查身份名:而
src/diary/compose.js:335-341里专为 manual 写了一条分支:这条分支永远走不到,素材只剩 QQ inbox 一条路。
<DSH_HOME>/media/onebot不存在的机器上,compose.js:355就是return skip("no-inbox-dir")。二、turn/end 的项目维度分支不可达
src/diary/auto.js:188-196(改前)写着:但
agentResolver由src/index.js:879无条件传入,而settleAgent→resolveAgentId(src/diary/agent-bucket.js:80-94)的四个返回分支——已落定 agent / 标题前缀命中人格卡 / preset 合法 / 兜底UNNAMED_AGENT——没有一个返回 null 或空串。于是
if (resolved && resolved.agentId)在任何机器、任何配置下恒真。项目维度从来没有被触发过。改法
一、手动路由把会话交给 compose
宿主的
session/event回调带的就是完整会话对象,而面板的?session=<id>只有 id —— 两者之间没有别的桥:宿主没有「按 id 取会话」的公开入口,读会话文件解 zstd 又等于把整条转录在请求里重放一遍。所以在
session/event里顺手留一份有界的对象引用:容量比身份账本(200)小得多——会话对象比一个字符串重得多,而命中率够:用户点「写今天」时,那个会话几乎必然是刚刚产生过事件的那个。只存引用不 clone,多挂一份不会延长它的生命周期。
手动路由改成:
取不到时传
null,不拿别的会话顶替——写出「A 的声音 + B 的事」比写不出来更糟。二、删掉死代码,不恢复项目维度
按「项目维度已由 agent 维度取代」处理:
return与后面的projectRootOf分支agentResolver真的缺席时(旧接线 / 纯测试)也不回落到项目维度:那种情况下没有任何身份可言,写出来的只会是_unnamed桶里一堆无名正文agentId时记一笔agent-resolve-empty,不静默为什么不恢复项目桶的自动触发:两个桶同时写会重复消耗 token,而 #613 本来就是往 agent 维度改的。存量项目桶只读保留——面板仍能翻、能导出。
三、inbox 缺席不再判死整次 compose
inbox 只是一条素材来源,不是唯一那条。原先把 inbox 缺席当成整次 compose 的死因,于是「这台机器没装 QQ 桥接」和「今天真的没东西可写」在界面上长得一样,用户连该去哪儿建目录都看不出来。
改成记下来继续走,最后与
no-material一并回报,并带上推导出的目录与hasSession。CHANGELOG 0.16.0 那句假承诺
这句话从来没有成立过(解析器由
src/index.js:879无条件注入)。历史条目按「不覆盖历史」保留原样,更正在[Unreleased]里:项目维度已由 agent 维度取代,存量项目桶只读。验证
测试 3,797 → 3,801(
test/api.test.js+2、test/diary.test.js+2):npm run sync已跑,check-sync报 136 个文件一致。变异自证四条,各自只红对应那条:
compose调用里删掉sessionsessionById没验到的
session/event通道的接线验证,没有起一个真宿主点按钮看结果。main座位注册时只传了{ t }(lib/client.js:15941),MnemeMainPanel拿不到sessionId,所以左侧只能走 inbox 路径。右栏 DiaryPane(lib/client.js:12947)是好的,它传了{ agent, session }。这属于宿主座位契约——要解决得先看main槽能不能拿到当前会话,不在本 PR 范围。已单独开 issue 跟踪(标needs-decision)。no-inbox-dir行不会回填。 本 PR 只保证之后不再产生这种笼统失败。Closes #795
Summary by CodeRabbit