你的姓名 d88c10c2df fix(server): defer runtime-config restart until session is idle
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
2026-06-08 02:18:00 +08:00

1.0 KiB
Raw Blame History

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 linttsc --noEmit
  • 本地 Windows x64 NSIS 打包(desktop/scripts/build-windows-x64.ps1+ package-smoke
  • Not-testedbun run check:server、desktop Vitest 未在本次执行;建议合并前补跑。