Skip to content

v1.6.1 — Performance, Robustness & DSH 0.2.2 Alignment

Choose a tag to compare

@Wasabi2575 Wasabi2575 released this 25 Nov 02:43
· 20 commits to main since this release

中文更新说明

本次 v1.6.1 聚焦于 60fps 交互流畅度、DSH 0.2.2 宿主源码契约对齐、执行稳健性、长期内存/磁盘卫生与后端模块化拆分,零破坏性变更。

性能与渲染优化

  • 精确面板可见性检测 & 折叠零轮询:对齐 DSH 0.2.2 keepMounted 机制,通过 [data-dockkit-content] 的 aria-hidden/inert + MutationObserver + IntersectionObserver,在折叠右侧边栏、切换 Tab 或切换会话时完全暂停轮询,展开瞬间 0ms 唤醒。
  • workspaceFiles.stat 优先探测:稳态轮询优先调用轻量 stat 比对元数据指纹,文件未变动或不存在(workspace-file/not-found)时 0 次 read 传输与 0 次 JSON.parse。
  • 60fps 拖拽合帧与零监听器抖动:拖拽事件收敛为单次 requestAnimationFrame 合帧并在松手时按实时坐标重算框选/拖线落点,消除高频指针抖动与快速甩手误差;平移期间开启 GPU 合成层 willChange。
  • 渲染热点隔离:图拓扑衍生计算通过 useMemo 缓存;运行计时拆入独立组件 LiveElapsedText;saveDoc 250ms 防抖并保护未落盘编辑时间戳与首次挂载不污染 localStorage。

DSH 0.2.2 契约对齐与执行稳健性

  • 根治条件节点 stopReason: 'error':对齐 DSH SubagentResult.diagnostic 真实错误字段;当 minimal 条件节点直接输出严格合法的 JSON 判决而未调用 structured_output 工具导致宿主改写 completed → error 时,第 1 次尝试即直接救援成功,零额外重试耗时。
  • 上游超长输出头尾裁剪:clipUpstreamOutput 对超长上游输出保留头部结论与尾部收尾/报错并折叠中间日志,内置 UTF-16 代理对边界保护(不劈断 Emoji/生僻字)。
  • 只读节点瞬态错误自动退避重试:仅对 minimal/condition 只读节点在 429/502/503/504/超时 等瞬态错误时执行 1 次可中断退避重试(响应 AbortSignal 零僵尸),绝不自动重试可写 standard 节点。
  • 原子写入与并发/输入防护:saveStore、publishCanvas、publishRunState 全部升级为唯一临时文件原子写入(writeFileAtomic);新增单会话 executePlan 重入互斥锁、运行/等待 Lead 拍板期间禁止自动同步冲掉进度、中文 IME 选词 Escape 防误关弹窗、sessionId 文件名安全清洗,以及更清晰的 fromNodes/canvas_generate/canvas_patch 输入校验与警告。

长期卫生与模块化

  • 后端内存映射全部 LRU 封顶(会话 ≤100、运行快照 ≤50、子会话槽 ≤400),自动清理超 14 天孤儿 .dsh/canvas/*.json 及超 1 小时遗留 *.tmp;前端 localStorage 持续限额淘汰旧会话草稿并严格保护全局配置键。
  • 后端纯图/裁剪/补丁与复盘快照/LRU/原子写逻辑抽离为零构建 ESM 模块 lib/graph.js 与 lib/telemetry.js,全部历史导出 100% 向后兼容;静态检查 12/12 与单测 84/84 全部通过。

English Release Notes

v1.6.1 focuses on 60fps canvas responsiveness, source-verified DSH 0.2.2 host contract alignment, execution robustness, long-term memory/disk hygiene, and zero-build backend modularization with zero breaking changes.

Performance & Rendering

  • Accurate panel visibility detection & zero idle polling while collapsed: Aligned with DSH 0.2.2 keepMounted semantics via [data-dockkit-content] (aria-hidden / inert) + MutationObserver + IntersectionObserver, pausing polling across collapsed sidebar, inactive tabs, and inactive sessions while waking on frame 0 upon expand.
  • workspaceFiles.stat-first polling: Probes file metadata before reading bytes, eliminating redundant read IPCs and JSON.parse work when files are unchanged or absent (workspace-file/not-found).
  • 60fps rAF drag coalescing & zero listener churn: Coalesces pointer moves to requestAnimationFrame with exact mouseup coordinate resolution for fast marquee/wire flicks and GPU willChange during panning.
  • Render isolation & debounced persistence: Memoizes graph topology derivations via useMemo, isolates the 1s live elapsed ticker into LiveElapsedText, and debounces localStorage writes (250ms) with unflushed-edit timestamp protection.

DSH 0.2.2 Alignment & Execution Robustness

  • 1-shot condition JSON rescue & diagnostic extraction: Aligned with SubagentResult.diagnostic and DSH activation.ts (completed → error when a minimal condition judge answers with direct JSON text instead of calling structured_output), rescuing strict JSON verdicts on attempt #1 without a wasted retry.
  • Surrogate-safe head+tail upstream clipping: clipUpstreamOutput folds oversized upstream outputs while preserving head conclusions and tail errors without ever splitting UTF-16 surrogate pairs.
  • Safe read-only transient retry: Single abort-aware backoff retry strictly for read-only (minimal/condition) nodes on transient 429/502/503/504/timeout errors; writable standard nodes never auto-retry.
  • Atomic writes & concurrency/input guards: Unified writeFileAtomic across saveStore, publishCanvas, and publishRunState; added single-session executePlan re-entrancy lock, auto-sync suppression while running/paused at Lead, CJK IME Escape guard, safeSessionFileBase filename sanitization, and actionable validation errors/warnings for fromNodes, canvas_generate, canvas_patch, and /canvas-sync.

Long-Term Hygiene & Modularization

  • LRU-bounded backend maps, throttled cleanup of >14-day orphaned .dsh/canvas/*.json and >1-hour *.tmp files, and ongoing localStorage session pruning preserving all global settings keys.
  • Extracted pure graph/prompt/patch helpers into lib/graph.js and telemetry/LRU/atomic-write helpers into lib/telemetry.js (100% backward-compatible index.js exports; npm run check 12/12 & npm test 84/84 passing).