feat(resources): 完善设备维护与 SD 资源调用闭环 - #26
Merged
Merged
Conversation
将 Application 广场分发、Hugging Face 固定提交安装、独立虚拟环境和受控启动器集成到设备维护分支,使桌面端可从同一 SDK 构建 watcher-distribution。 合并时保留无 Application 的透明路由语义与全部固件、SD 资源维护接口,删除旧 .wapp Catalog 和冻结 Runtime 直启 Application 的旁路;同时补齐类型依赖并修正媒体转换类型边界。 验收:SDK 全量 610 项测试通过,mypy 检查 85 个源码文件零错误;桌面 PyInstaller 已成功收集 Daemon、默认 Application、分发 CLI 与天气 sidecar,并在最终来源锁门禁处按预期拒绝未提交 SDK。
动态解析 Windows kernel32 卷管理接口,避免 Linux/macOS 类型检查直接访问 ctypes.windll 失败,同时保持非 Windows 平台不枚举卷的既有行为。 补充缺少 Windows 卷 API 时的回归测试,并为调用方返回明确的维护错误。此提交配套 ESP32 codex/sd-ota-resources-dev 与桌面端 codex/firmware-resource-maintenance 的资源维护闭环。
将 Application 冷启动等待窗口提高到 90 秒,覆盖 Windows 默认 Application 首次加载耗时。 固件高速烧录失败后重新请求设备进入 ROM 下载模式,再以 460800 baud 完整重试,避免 esptool 复位后沿用失效连接。 补充回归测试、排障文档,并通过 612 项 SDK 测试及 COM29 v0.3.3 实机烧录与版本、SD 作品读取验收。
本次提交修复大型 SD 官方资源包在设备端持续解压时被统一 900 秒超时误判的问题。 主要改动: - 将资源启用总时限扩展到 30 分钟,覆盖串口上传、解压、校验和原子切换全过程。 - 增加 120 秒无进度停滞检测;设备持续上报有效 STATUS 时刷新停滞截止时间。 - 超时错误携带最后阶段、进度和设备明细,便于区分正常慢速处理与真正卡死。 - 保持同版本资源可重复安装,不新增跳过逻辑。 TDD / 验证: - 新增停滞心跳及错误上下文回归测试。 - python -m pytest tests/runtime/test_maintenance_service.py -q:33 项通过。 文档: - 更新资源维护说明,记录同版本重装、总时限、停滞阈值和诊断语义。 配套关系: - 配套 WatcheRobot_esp32 的异步解压及 STATUS 心跳修改。 - 桌面端可消费阶段、文件字节数和吞吐量明细。
orulink-wugui
marked this pull request as ready for review
August 7, 2026 03:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
本 PR 替代 #24。
旧分支曾通过双父 merge commit
ba9036e5d12821192c62dbe7c29cad2c0d3df13f合入 Application 分支1ed28630cd1b8a6d5529f35c909de4bc4341bc1b,导致 GitHub 在旧 PR 中展示另一条分支的历史。当前远端main已通过 PR #22 正式包含 Application 相关提交,因此本 PR 从最新origin/main重新建立,只迁移 SDK 设备维护与资源闭环的最终代码差异。新分支没有携带
ba9036e,相对main只有 4 个普通单父提交。迁移前后 Git tree 哈希完全一致,确保旧分支中的功能、测试和文档没有丢失。本次改动
固件与 SD 资源维护
用户作品与官方表情
clip_id播放。robot.expressions.play_official调用官方表情。robot.works.play_expression调用用户作品中的单个表情。Daemon 与 Application 边界
跨平台兼容
ctypes.windll。历史清理说明
main,提交5f15233。ba9036e。23fcbddb6db2892703c6a595fb6b347b8116dd1fTDD / 验证
.venv\Scripts\python.exe -m pytest -q.venv\Scripts\python.exe -m mypy srcgit diff --check origin/main...HEAD:通过。测试仅保留一条预期的 ZIP 重复文件名警告,用于验证重复条目会被拒绝,不代表功能失败。
配套仓库
codex/sd-ota-resources-dev/ PR #131。codex/sd-resource-install-progress/ PR #97。风险与注意事项
dev分支,因此本 PR 按仓库实际主线和既定策略提交到最新main。