mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-27 15:13:37 +08:00
v0.5.3's one-shot skip only blocked a single auto-drain, but a Stop emits multiple idle events (message_complete + status idle); the second one still drained one queued message and flipped the button back to running. Replace the one-shot skip with a sticky queueDrainPaused flag: Stop pauses all auto-drains until the user sends their next message (which clears it and fires immediately, ahead of the queue). The queue then resumes FIFO on the next idle. Bumps desktop app to 0.5.4 with release notes. Tested: tsc --noEmit; Vitest chatStore 94 passed (incl. multi-idle stop / priority message / queue resume); browser end-to-end (Stop keeps button at Run with queue intact, priority send immediate, queue resumes); Windows x64 NSIS package + package-smoke PASS. Scope-risk: narrow Confidence: high
1.4 KiB
1.4 KiB
v0.5.4
修复
- 彻底修复"点击停止仍会消费一条队列消息"。v0.5.3 的一次性跳过只挡住一次自动续队,
而停止会产生多个 idle 事件(
message_complete+status idle),第二个事件仍会续队、 消费一条消息并把按钮重置回运行中(需再点一次才停得下来)。 现在改为暂停标志:点击停止后持续跳过所有自动续队,直到用户发出下一条消息才解除——- 停止只停当前回合,一条队列消息都不消费,按钮稳定停在"运行"。
- 此时再发消息立即优先触发(不进队列,即使队列有货)。
- 该优先消息完成后,队列在下一次 idle 照常按 FIFO 继续。
范围
- 修改:
desktop/src/stores/chatStore.ts(一次性skipNextQueueDrain改为持久queueDrainPaused, 停止时置位、drainMessageQueue始终跳过、sendMessage解除)。 - 仅桌面端逻辑改动;队列入队/排空/编辑机制与持久化未变。
验证
cd desktop && bun run lint(tsc --noEmit)✅- desktop Vitest:chatStore 94 passed(含"停止后多次 idle 都不 flush + 优先消息 + 队列续上"用例)✅
- 浏览器端到端:工作中入队 2 条 → 点停止后按钮稳定 Run、队列保持 2、零消费;发优先消息立即触发、不入队; 优先消息完成后队列自动续上(甲→乙)✅
- 本地 Windows x64 NSIS 打包 + package-smoke ✅