fix: p2p 无话题消息并行执行 - #135
Conversation
根因:dev agent (replyMode=thread) 的 p2p 消息在无 threadId 时
共享同一队列键 `dev:${chatId}`,导致后续消息必须等前一条完成。
实际上每条无 threadId 的消息会由 resolveThreadContext 创建独立话题,
不需要串行等待。
修复:thread 模式下无 threadId 的消息用 messageId 区分队列键,
使每条消息可独立并行执行。direct 模式不受影响(仍按 userId 串行)。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
覆盖 thread/direct 模式下队列键的构建逻辑: - thread 模式无 threadId → per-message 并行 - thread 模式有 threadId → per-thread 串行 - direct 模式无 threadId → per-user 串行 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude finished @lishuceo's task in 1m 24s —— View job Review of PR #135
✅ Approved with minor suggestionOverall assessment: Clean, well-scoped fix. The root cause analysis is correct — thread-mode p2p messages without a What looks good:
One issue found:
See inline comment for details and suggested fix. |
address PR review feedback: 导入 _testing.makeQueueKey 替代重复实现, 添加 event-handler.ts 依赖链所需的 mock(pipeline/store, agent/router 等)。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude finished @lishuceo's task in 1m 20s —— View job Review of PR #135 (re-review after fixes)
✅ Approved — 1 previous issue fixed, no new issues foundPrevious issue resolved: Tests now import Re-review of current changes: The fix is clean and well-scoped. The core logic at Tests are thorough — 7 cases covering all mode/threadId combinations, now using the production No bugs, security issues, or architectural concerns found. |
* fix: p2p 无话题消息并行执行,避免同 chat 串行等待
根因:dev agent (replyMode=thread) 的 p2p 消息在无 threadId 时
共享同一队列键 `dev:${chatId}`,导致后续消息必须等前一条完成。
实际上每条无 threadId 的消息会由 resolveThreadContext 创建独立话题,
不需要串行等待。
修复:thread 模式下无 threadId 的消息用 messageId 区分队列键,
使每条消息可独立并行执行。direct 模式不受影响(仍按 userId 串行)。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test: 队列键并行执行策略测试
覆盖 thread/direct 模式下队列键的构建逻辑:
- thread 模式无 threadId → per-message 并行
- thread 模式有 threadId → per-thread 串行
- direct 模式无 threadId → per-user 串行
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: 测试改用生产代码 makeQueueKey,添加缺失的 mock
address PR review feedback: 导入 _testing.makeQueueKey 替代重复实现,
添加 event-handler.ts 依赖链所需的 mock(pipeline/store, agent/router 等)。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Summary
dev:${chatId},导致同一 chat 内所有消息被串行化。实际上每条无 threadId 的消息会由resolveThreadContext创建独立话题,不需要串行等待messageId区分队列键,使每条消息可独立并行执行。direct 模式(Chat Agent)不受影响Test plan
🤖 Generated with Claude Code