fix(channels): stop dropping multi-task messages when a channel memory is saved - #7608
Conversation
…y is saved A classifier-detected `remember` intent made processInbound() return early, so a message like "Review PR QwenLM#123. Remember X. Also check PR QwenLM#456" saved the memory, replied with a confirmation, and never routed the message to the agent — tasks 1 and 3 were silently dropped (QwenLM#7601). Classifier-detected remembers now save silently as a side-effect and let the message continue to the agent: the confirmation is suppressed (the agent's reply is the single response, and the just-saved entry reaches the same prompt via channel-memory recall), while save failures still surface. Explicit remember phrases and every management intent (list/inspect/ update/remove/clear and their confirmations) keep the early return — there the whole message is the command. Fixes QwenLM#7601 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Thanks for the PR! Template looks good ✓ Problem: observed bug with solid evidence. Issue #7601 (filed by a maintainer, labeled Direction: aligned — this is a straightforward bug fix in channel memory routing. The early Size: not applicable — changes are in Approach: the scope feels right. Two files, ~20 lines of production logic, the rest is tests. The Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓ 问题:已观测到的 bug,证据充分。Issue #7601(由维护者提交,标记 方向:对齐——这是 channel 记忆路由的直接 bug 修复。 规模:不适用——改动在 方案:范围合理。两个文件,约 20 行生产逻辑,其余为测试。 进入代码审查 🔍 — Qwen Code · qwen3.8-max-preview Reviewed at |
Code ReviewIndependent proposal: given the root cause (unconditional early return after Findings: no critical blockers or convention violations.
TestingUnit tests (PR branch, Full package suite: Typecheck ( Build + CLI smoke test (tmux, PR branch): Full E2E channel testing (sending a multi-task message through a live DingTalk/WeCom channel) requires a configured channel server with API credentials, which isn't available in this CI environment. The unit tests exercise the exact 中文说明代码审查独立方案: 根据根因( 发现: 无关键阻塞项或规范违反。
测试单元测试(PR 分支):ChannelBase.test.ts 502/502 通过;整包 890/890 通过。类型检查干净。构建 + CLI 冒烟测试正常。完整 E2E channel 测试需要配置好的 channel 服务器(DingTalk/WeCom),CI 环境不可用。单元测试以 mock channel 和确定性分类器替身直接覆盖了 — Qwen Code · qwen3.8-max-preview Reviewed at |
|
Confidence: 5/5 — clean, minimal fix for a real bug; would merge without hesitation. This is a textbook bug fix. The problem is real (multi-task messages silently dropped when a classifier-detected remember triggers an early return), the root cause is correctly identified (unconditional The implementation is ~20 lines of production logic. The Tests are thorough: two new tests cover the multi-task scenario and the save-failure-still-forwards case, and existing classifier-remember tests are updated to expect the new behavior (agent gets the message). 502/502 in ChannelBase.test.ts, 890/890 across the package, typecheck clean. The only thing I couldn't verify is a live E2E channel test (requires a configured DingTalk/WeCom server), but the unit tests exercise the exact 中文说明置信度:5/5 —— 干净、最小化的真实 bug 修复;毫不犹豫地合并。 这是一个教科书式的 bug 修复。问题真实存在(多任务消息在分类器识别出 remember 意图后因早退而被静默丢弃),根因定位正确( 生产逻辑约 20 行。 测试充分:两个新测试覆盖多任务场景和保存失败仍转发场景,现有分类器记忆测试更新为期望新行为。ChannelBase.test.ts 502/502,整包 890/890,类型检查干净。 唯一无法验证的是实际 E2E channel 测试(需要配置好的 DingTalk/WeCom 服务器),但单元测试以确定性分类器替身直接覆盖了 — Qwen Code · qwen3.8-max-preview Reviewed at |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
— qwen3.7-max via Qwen Code /review
Maintainer local verification — real build & tests ✅I built this PR in an isolated worktree at head 1 · Suites & gates on the PR head — all green
2 · Independent E2E — my own spec, not the PR's tests (3/3)I wrote a fresh spec that drives the real
3 · Discriminating A/B — revert the fix, keep the testsOverlaying
Notes
Verdict: LGTM — merge-ready. The 3-stage triage bot review and this independent local reproduction agree. Verified on macOS (Darwin 24.6) · Node v22 · vitest v3.2.4. The independent spec ( 中文说明(点击展开)维护者本地验证 —— 真实构建与测试 ✅我在隔离 worktree(head (截图见上方英文部分) 1 · PR head 上的套件与 gate —— 全绿
2 · 独立 E2E —— 我自己写的 spec(非 PR 自带测试),3/3该 spec 通过一个具体子类、Map 存储、以及作为「是否到达 agent」唯一探针的
3 · 判别式 A/B —— 还原修复、保留测试把
补充
结论:LGTM,可合并。 三阶段 triage 机器人审查与本次独立本地复现结论一致。 验证环境:macOS(Darwin 24.6)· Node v22 · vitest v3.2.4。独立 spec( |

What this PR does
Makes a classifier-detected
rememberintent a side-effect instead of a message-consuming command:ChannelBase.processInbound()still saves the memory, but now suppresses the bot's "Channel memory … saved." confirmation and lets the full message continue through normal routing to the agent, so the other tasks in the message actually run. The agent's reply becomes the single response, and because the save invalidates unattended memory before the prompt is built, the just-saved entry reaches that same prompt via channel-memory recall — the model knows the save happened without any injected turn. Save failures still surface unconditionally. Everything else keeps its early return by design: explicit remember phrases matched byparseChannelMemoryIntent(there the whole message is the command) and every management intent — list/inspect/update/remove/clear and their confirmation flows.Why it's needed
#7601: a multi-task message like "Review PR #123. Remember that code reviews should use inline comments. Also check PR #456" saved the memory, replied with a save confirmation, and silently dropped tasks 1 and 3 — the early
returnafterhandleChannelMemoryIntent()never routed the message to the agent. The triage confirmed this root cause inprocessInbound()and endorsed exactly this fix direction (option 2: make the save silent and continue with the full message), scoped toprocessInbound()andhandleChannelMemoryIntent().Reviewer Test Plan
How to verify
qwen serve --channel dingtalk-qa), send one message that combines a real task with a natural-language remember, e.g. "Review PR [BUG]内建工具网络访问问题 #123. Remember that code reviews should use inline comments. Also check PR feat: add project-specific memory storage support #456." Before this PR: the bot only replies "Channel memory … saved." and the PR-review tasks never run. After: the memory is saved, no bot confirmation is injected, and the agent handles the whole message (its prompt even contains the just-saved entry via recall).npx vitest run src/ChannelBase.test.tsinpackages/channels/base(502/502; whole package 890/890).Evidence (Before & After)
E2E against the compiled
ChannelBase(real Map-backed memory store, bridge records exactly what reaches the agent, deterministic stand-in for the LLM classifier), before/after viagit stash+ rebuild:Tested on
Environment (optional)
macOS (Darwin 24.6), Node v22; vitest.
npm run typecheck,eslint --max-warnings 0,prettier --checkall clean.Risk & Scope
handleChannelMemoryIntentare now only reachable from the explicit single-text parse path; left in place to keep the diff minimal. No classifier/prompt changes.Linked Issues
Fixes #7601
中文说明
本 PR 做了什么
把分类器识别出的
remember意图从「吞掉整条消息的命令」改为「副作用」:ChannelBase.processInbound()仍然保存记忆,但抑制机器人的 "Channel memory … saved." 确认消息,并让完整消息继续走常规路由交给 agent,消息里的其它任务得以真正执行。agent 的回复成为唯一响应;且由于保存后会失效未读记忆缓存,刚保存的条目会经 channel-memory recall 注入同一条 prompt——模型无需任何注入回合就知道保存已发生。保存失败仍然无条件提示。其余路径按设计保持早退:parseChannelMemoryIntent命中的显式记忆短语(整条消息就是命令本身),以及全部管理类意图——list/inspect/update/remove/clear 及其确认流程。为什么需要
#7601:多任务消息如 "Review PR #123. Remember that code reviews should use inline comments. Also check PR #456" 会保存记忆、回复保存确认,然后静默丢弃任务 1 和 3——
handleChannelMemoryIntent()之后的早退return使消息永远到不了 agent。triage 已确认processInbound()中的这一根因,并背书了正是本 PR 的修复方向(方案 2:静默保存并继续处理完整消息),范围限定在processInbound()与handleChannelMemoryIntent()。审阅测试计划
如何验证
qwen serve --channel dingtalk-qa)发送一条「真实任务 + 自然语言记忆」组合消息:本 PR 之前机器人只回 "Channel memory … saved." 且任务不执行;之后记忆保存、无确认注入、agent 处理整条消息(其 prompt 中还能通过 recall 看到刚保存的条目)。packages/channels/base下npx vitest run src/ChannelBase.test.ts(502/502;整包 890/890)。证据(Before & After)
对编译产物
ChannelBase的 E2E(真实 Map 存储、bridge 记录到达 agent 的内容、确定性分类器替身),git stash+ 重建做前后对照:未修复时 agent 收不到任何内容、只回保存确认;修复后完整消息 + recall 记忆到达 agent、单一回复。两条新测试在未修复源码上失败;显式/管理类路径行为不变。测试平台
macOS 已本地验证(✅);Windows / Linux 依赖 CI(⚠️ )。
环境
macOS(Darwin 24.6)、Node v22;vitest;typecheck / eslint / prettier 全绿。
风险与范围
handleChannelMemoryIntent中的多 id 确认文案现仅显式单条解析路径可达,为保持最小 diff 原样保留;未改动分类器/提示词。关联 Issue
Fixes #7601
🤖 Generated with Claude Code