- 四组并行完成:main/wire*.go、wire_capacity|channels|runtime、channels|persona_*|emotion|observability、 voice|plugins|stream|skills|vision|subagent_tool|extractor|mcp|sessionread_tool|terminal_tool。 - 机械校验(git diff -U0 去 // 行与空行)仅剩 wire_frontend.go:84 一处行尾注释:代码前缀 「\ta.gw = gw 」经 cat -A 与 HEAD 逐字节比对一致(allow 清单已声明)。 - 验收:隔离 worktree(HEAD + 本批 patch)go build/vet 绿、全树 58 包 ok、 linux/amd64 + darwin/arm64 交叉编译绿;gofmt -l 干净。 - 备注:整树两次红均为负载敏感 flake(backthink / orchestration 的 timeout 类用例单独 -count=20 全过)。
- 新增 model/stream.go:StreamKind(text/thinking/tool_call 各 start/delta/end + tool_execution) + StreamEvent{Kind,Delta,Index,ID}。 - ChatStream 签名 onChunk func(delta string)→onEvent func(StreamEvent);loop OnStream 同改; streamStep 转发结构化事件。 - openai:text_delta + text_start/text_end(正文三段式);anthropic:文本块 text_*/tool_call_* 按块 Index(content_block_stop 分支)真分段;fallback:有事件即交付。 - ws_hub:wsEvent 壳补 turnId/seq;新增 broadcastStream;streamChat 每帧打 turnId+seq; stream.go 把事件 publish 到 bus ws.stream。 - ws_bridge:streamEventData 映射 text_*→message.start/delta/end、thinking_*→thinking.*、 tool_call_*→tool_call.*、tool_execution_update→tool_execution.update,未知回退 stream_chunk。 - 前端 ws.ts:解析 message.start/delta/end、thinking.start/delta/end(pendingThinking)、 tool_call.start/end→addTool、tool_execution.update;保留旧 stream_chunk/thinking/tool_used 兼容; types.ts 补 turnId/seq。Docs/api-client.md 增 §3.1 v0.4。 已知限制(注释/文档标注):turnId 在 OnStream→bus→relay 路径暂为空(StreamEvent 无 turnId 字段, bus ws.stream 载荷不带 turn);OpenAI adapter 未解析 tool_call 段;thinking 段两 adapter 暂不发; tool_execution.update 是保留项(随工具循环钩子后置)。go build/vet/test + 前端 tsc 全绿。
打通前端 ws.ts 里那批死消费者事件(thinking/mood/tool_used/subagent_event/ task_output/device_update/reminder/backthink),并给 loop 接真 token 流式。 - wire.go:loop 建时传 OnStream(streamChunk 闭包把 delta 发 bus ws.stream_chunk); gateway.Deps 注入 Scheduler/Tasks/Streaming;iot 接共享总线 iot.WithBus(a.bus)。 - ws_bridge.go:hub 额外订阅 iot.>/task.>/automation.>/reminder.>/cyrene.agent.*.event, normalizeEvent 归一为 ws.*(device_update/task_output/task_done/automation_result/ reminder/subagent_event);不订阅 cyrene.agent.> 以免 ask/reply 内部事件进 relay。 - ws_route.go:voice_input→ws.voice_input;subagent_ask→Scheduler.AuditContext(真实 上下文审计,替换 pending stub);task_output_query→Manager.TaskOutput(真实输出, 替换空 {})。 - server.go:新增 SubagentAuditor/TaskOutputStore 接口 + Deps.Scheduler/Tasks/Streaming。 - orchestration/auditcontext.go:Scheduler.AuditContext(full/tail/keyword)。 - task/manager.go:Manager.TaskOutput(id)。 - backthink:record() 补发 ws.backthink 事件。 - json tag 修正(device_update/reminder/task output 结构体加小写 tag + DeviceUpdate 补 message),使前端分支能真正渲染。 实机验证:WS 握手 101、task manager ready、iot manager initialized(WithBus 生效)。 go build/vet/test 全绿;TestHubBridgeDeviceUpdate/TestHubBridgeSubagentProgress 覆盖 映射。dev 推至后续版本。