mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-27 15:13:37 +08:00
In-progress generations were interrupted when a set_runtime_config arrived mid-stream: the handler immediately stopped and restarted the CLI subprocess. Track per-session busy state from outbound status events and queue the restart, applying it (with the latest override, collapsing multiple toggles) once the session returns to idle. Bumps desktop app to 0.5.1 with matching release notes. Tested: desktop tsc --noEmit; Windows x64 NSIS package + package-smoke. Not-tested: check:server, desktop Vitest. Scope-risk: narrow Confidence: medium
1.0 KiB
1.0 KiB
v0.5.1
修复
- 流式生成进行中切换运行时配置不再打断当前回复(modelId / effortLevel / 会话级思考开关)。
此前任何
set_runtime_config在会话忙时都会立刻stopSession并重启 CLI 子进程, 导致正在生成中的回复被截断。新增按会话的 busy 跟踪与"等待 idle 再 apply"的延迟队列: 会话忙时仅记录最新覆盖值,转入 idle 后再统一执行一次重启,期间多次切换会自然合并。
范围
- 修改:
src/server/ws/handler.ts(新增sessionGenerationBusy跟踪 + 延迟重启队列,handleSetRuntimeConfig的两处重启改为scheduleRestartSessionWithRuntimeConfig)。 - 仅服务端逻辑变更;UI / IPC / 持久化 schema 均未改动。
验证
cd desktop && bun run lint(tsc --noEmit)✅- 本地 Windows x64 NSIS 打包(
desktop/scripts/build-windows-x64.ps1)+ package-smoke ✅ - Not-tested:
bun run check:server、desktop Vitest 未在本次执行;建议合并前补跑。