Repository navigation
Conversation
DSH and plugins put notes into a running turn as user messages: the clock, memory, the skill catalog, model and job notices, and plugin recalls. The reply-origin check treated every one of them as another source, withdrew the chat's claim and marked the turn mixed, so the Bot's answer never reached the IM chat and nothing was logged. Ignore the notes; a real message from the Web UI, another Bot or a scheduled task still withdraws the claim. Fixes Fei2411#1718
There was a problem hiding this comment.
🔍 Devin Review: 1 flag
Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
Fei2411
left a comment
There was a problem hiding this comment.
Verdict: COMMENT — recommend closing in favour of #1750 (same bug, #1718/#1735).
The tests pass on dev a95e3af (2899/0) and the intent is right, but #1750's approach is safer:
pendingResetis consumed by a context note.pendingReset.delete()runs beforeisContextNote()is checked, so in a group Session's late turn a lone context note uses up the pending reset without resetting the origin. If no classifying message follows, the previous turn's origin survives (fail-open). #1750 returns beforependingResetis touched.- The classifier is too broad. Treating every
plugin:kind as context can hide a real plugin-delivered request, which would then answer an IM chat that never asked. The extra forms (catalog,recall,instructions,notice) and kinds should only be added once DSH is confirmed to emit them into a running turn asuser/message.
Suggestion: if any non-snapshot form really does appear in practice, a small follow-up on top of #1750 (same early-return position, an explicit list, no plugin: wildcard) would cover it. Your two tests (the multi-source loop and the note-before-IM-message case) are worth porting there.
|
Thanks for the fix, @jiejiesks! #1750 covers the same IM reply problem (#1718/#1735) in one change, so closing this one in its favor. |
Issue
Fixes #1718
What changed / 改了什么
ds-bot/src/host/im/index.js: a turn's reply origin is withdrawn whenever auser/messagethat is not the IM request joins the turn. DSH and plugins also put context into a running turn as user messages — the clock, memory, the skill catalog, model and job notices, plugin recalls. Those were treated as another source:dropOrigin()cleared the chat's claim and marked the Sessionmixed, so every reply in that turn stayed in the app and nothing was logged.isContextNote()recognises that context by its form (snapshot,catalog,recall,instructions,notice), by the DSH/DS Bot context kinds (compact-checkpoint,runtime-context,skill-catalog,model-selection,time-context,ds-bot-time-context,ds-bot-memory-update) and by aplugin:kind prefix, and leaves the origin alone. A real message from the Web UI or phone (a user message with a non-IMrpcId), a peer Bot, a scheduled task, or an answer given elsewhere still withdraws it.Two regression tests: a context note after the IM message and a context note before it both still answer the IM chat.
Changelog
IM replies no longer go missing when the turn also carries injected context, such as the clock, memory, the skill catalog or a plugin's recall.
How I checked it / 怎么验证的
npm test(inds-bot/) —test/im.test.jspasses 61/61, including the two new cases. The full run in this environment has 25 failures, all intest/connectors-engine.test.jsandtest/doctor.test.js, caused byThis DSH cannot load connectors(upstream HTTP 502); they are unrelated to this change.node scripts/build-client.mjs --check— no client change.npm run lintindex.jsorsrc/host/— not run: this machine has no../deepseek-harnesscheckout.Checklist / 检查
src/client/not changed. / 没改src/client/。Co-authored-by. / 没有把 AI 工具写成作者或Co-authored-by。