Files
HomeAgent/internal/plugins/remotedevice
JianFeeeee fad490dca0 fix(remotedevice): 媒体回传落盘 + webui SSE panic + GUI 相机跨平台
1. remotedevice 媒体落盘(核心改动)
   设备录像/照片二进制聚合后写入 <data>/device_media/<reqID>.<ext>,
   cmd_result 返回 file 路径,不再 base64 内联——10s 录像数 MB 的
   base64 会撑爆 LLM 上下文与工具结果管道。未配置目录时保持旧内联行为。
   新增 TestWSBinaryMediaToFile 覆盖。

2. webui SSE 'send on closed channel' panic(生产单日 4924 次)
   handleChatEvents 的 defer close(writeCh) 与 Subscribe 回调闭包竞态:
   handler 退出后总线仍可能异步触发回调向已关闭 channel 发送。
   改为 writer goroutine select on done 退出,不 close channel;
   defer 中等待 writerDone 保证无残余写入。
   顺带补 mockPluginMgr.StopAndUnload(ae42e48 接口变更漏改测试)。

3. GUI camerasue 平台分支
   ffmpeg 参数原硬编码 Linux v4l2(/dev/video0),Windows 上必然失败。
   现按平台探测:win32=dshow(枚举设备名取第一个视频设备)、
   darwin=avfoundation、linux=v4l2;录像编码 Windows 交给 mp4 muxer 默认。
2026-08-26 01:25:40 +08:00
..