feat: 处理任务时给排队消息一个反馈#39
Open
1359484419 wants to merge 1 commit into
Open
Conversation
用户在 Claude 处理任务期间发的消息会进入串行队列等待,但此前没有任何反馈, 用户对着空白聊天框干等、容易误以为消息丢了。 - onMessage 入队时,若已有任务在处理,立刻回一句排队提示 - 一波忙碌期内只提示一次(queueNoticeSent 标志),避免连发刷屏 - drainQueue 清空队列后复位标志,下一波忙碌可再次提示 - 仅对用户消息提示,不影响 /stop /clear 优先命令的即时处理
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.
问题
用户在 Claude 处理任务期间发的消息,会进入串行队列等待当前任务整个跑完才被处理;在此期间没有任何反馈。用户对着空白聊天框干等,容易误以为消息丢了或机器人挂了。
改动
onMessage入队时,若已有任务在处理(processingQueue),立刻回一句排队提示:「⏳ 正在处理上一条消息,你后面发的我都收到了,会处理完依次回复。」queueNoticeSent标志),避免用户连发消息时被刷屏drainQueue清空队列后复位标志,下一波忙碌可再次提示MessageType.USER)提示;/stop、/clear优先命令的即时处理不受影响验证
npm run build(tsc)通过