DrSmoothl
298d174640
refactor(webui): extract openSseChannel for the three EventSource openers
stateStream / openLogStream / openDebugStream 三个 EventSource opener 近乎逐字重复
(token 守卫 → EventSource → onopen/onerror → onmessage try-parse-catch → close
disposer),token/reconnect/畸形帧-跳过 语义各写一遍、易漂。
- 新增私有 openSseChannel<T>(path, onMessage, onStatus?) 收敛骨架;各 opener 塌成
一行调用,consumer 逻辑作为 onMessage 传入(保持「回调在 try 内、抛错当畸形帧
吞掉」语义)。logs 的控制帧过滤(`'type' in parsed`)留在其 onMessage 回调里。
- StreamStatus 提到顶部 import,删掉 openDebugStream 的 inline import。
行为严格不变、对外签名不变:webui typecheck(tsc -b) + vite build 干净;对抗性 Agent
逐字对比 HEAD 确认三 opener 等价、onMessage-在-try-内 语义保留、无漏并入。
2026-07-01 18:58:22 +08:00
..
2026-07-01 18:58:22 +08:00
2026-06-16 19:53:31 +08:00
2026-06-30 17:17:15 +08:00
2026-06-19 02:27:04 +08:00
2026-06-28 22:16:07 +08:00
2026-05-05 00:39:52 +08:00