Repository navigation
v0.8.1 修复番茄钟提醒把会话打死 - #8
Merged
Merged
Conversation
番茄钟走完时插件用 agent.followup() 把提醒塞进起钟会话,source 写成
{ kind: 'plugin', plugin: 'dsh-study-desk', … }。宿主会话格式 v4 把这个形状判为
退役语法(app.asar 的 source() 见到 kind === 'plugin' 就抛),agent/inbox/spliced
整条落盘被拒,会话从那一刻起每一轮都报
format v4 message requires a producer-owned source kind。
改用 plugin:<包名> 这种生产者自己命名的 kind(宿主只要求非空且不是裸 plugin),
并为它加一层单一出口:MESSAGE_SOURCE_KIND 与 timerEndSource(),不再手写字面量。
- index.js: 新增 MESSAGE_SOURCE_KIND / timerEndSource(),timerEndHook 改用工厂
- apply-probe.mjs: 端到端断言同步到新 kind
- test/message-source.test.js: 4 条回归(含静态扫,禁止裸 kind 'plugin' 回潮)
- AGENTS.md: 更新过时的 source.kind 说明、文件地图与单测数量
- CHANGELOG/package.json: v0.8.1
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 51 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
原来那条守卫直接对文件原文跑正则,index.js 里解释退役语法的注释 (「kind 一律写 plugin」那几个字)离踩线只差一个冒号,随时会误红。 - test/message-source.test.js: 新增 maskComments(),把块注释/行注释抹成空格 (保留换行与字符串),扫描前先过一遍:注释里讲旧写法放过,代码里写了才抓 - 新增一条「扫描器不空转」自证:注释三种写法不误红、代码三种引号必须抓到、 plugin:dsh-study-desk 与 pluginish 不许误伤
modusensus
force-pushed
the
feat/v0.8.1
branch
from
November 5, 2026 01:43
0b66a9f to
423848a
Compare
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.
症状
某个会话在番茄钟停止的那一刻突然瘫痪:历史还在,但之后每一轮回复都只有一行
format v4 message requires a producer-owned source kind。根因
番茄钟走完时
index.js用agent.followup()把提醒塞进起钟会话,消息的source写成{ kind: 'plugin', plugin: 'dsh-study-desk', event: 'timer-end', at }。宿主会话格式 v4 把「kind 一律写
plugin、只靠plugin字段认来源」判为退役语法(
app.asar里source()见到kind === 'plugin'直接抛),而followup的消息会原样落进agent/inbox/spliced.data.inserted[],于是整条事件落盘被拒,那个会话从此每轮都撞同一堵墙。改法
改用生产者自己命名的 kind
plugin:dsh-study-desk(宿主只要求「非空且不是裸plugin」,前缀就是来源标记;
clearai/@modusensus/dsh-mneme在现有会话里早已这么写)。并把它收成单一出口,不再手写字面量:
验证
node --test:77 / 77 通过(原 73 + 新增 4)。node apply-probe.mjs:✓ 全部通过,含「专注走完 → 提醒以 user 消息送进起钟会话」。node install.mjs --check:profile 接线全 ok,patch 仍为裸包名。source改回裸kind: 'plugin'→ 新增的静态扫用例红、apply-probe.mjs端到端也红(✗ 1 项失败);还原后全绿。session.v4文件,已有 4989 处被宿主接受的plugin:source,确认这是现行合法写法。
Summary by CodeRabbit