关于模型设置-模型下载进度条的若干修复#293
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
PR Reviewer Guide 🔍(Review updated until commit 47b086e)Here are some key observations to aid the review process:
|
|
@claude 审查一下,按照逻辑结构清楚分析一下,合并到主代码后可能会有哪些问题?是否可以合并?它做得如何?代码质量如何?是否破坏了前端 UI?是否结构拆分逻辑清楚? |
|
Claude finished @appergb's task in 2m 39s —— View job PR #293 代码审查报告任务清单:
总体评价代码质量 中上,修复方向正确,逻辑链清晰。三个文件分工明确,后端负责真实字节计算,前端负责 UI 响应。存在 一个中等 UX 缺陷(非数据损坏),无安全风险,无 UI 破坏,可谨慎合并,建议同步修复下述问题后再合并或随后跟进。 逻辑结构分析PR 的改动形成一条清晰的数据链: 三层分工合理,没有跨模块乱调,符合 后端审查(
|
| 维度 | 结论 |
|---|---|
| 功能正确性 | ✅ 核心修复逻辑正确 |
| 数据安全 | ✅ 无数据丢失风险 |
| 前端 UI | ✅ 无破坏 |
| 结构拆分 | ✅ 分工清晰 |
| 主要 UX 缺陷 | |
| 测试覆盖 |
结论:可以合并,建议将 bytesDownloaded 初始化问题作为后续 follow-up 修复,或在本 PR 内一并处理后合并。自动化 reviewer 的"Incorrect size accounting"批评经分析是误判,不影响合并判断。
|
@Hongbro886 解决 claude 提出的问题,然后再次准备完成后即可合并。 |
|
Persistent review updated to latest commit 47b086e |
|
@claude 需要严格审核他提交的内容和更改,同时为跨平台做好准备和分析。 |
|
Claude finished @appergb's task in 3m 46s —— View job 任务清单:
PR #293 严格审查 + 跨平台兼容性分析
一、跨平台兼容性分析🔴 严重:Windows NTFS 不创建真正的稀疏文件
// download.rs ~line 558
f.set_len(total_size)
.with_context(|| format!("set_len partial failed: {}", partial.display()))?;
Windows 要创建真正的 sparse 文件,必须在
修复建议:使用条件编译,Windows 路径跳过稀疏文件预分配,改用顺序写入: #[cfg(windows)]
{
// Windows: 不预分配 sparse,直接创建空文件,每 chunk seek+write
std::fs::OpenOptions::new().write(true).create(true).open(&partial)?;
}
#[cfg(not(windows))]
{
let f = std::fs::OpenOptions::new().write(true).create(true).open(&partial)?;
f.set_len(total_size)?;
}或者引入 目前如果 Windows 上 🟡 中等:
|
| 维度 | 评分 | 说明 |
|---|---|---|
| 逻辑正确性 | ✅ 中上 | 核心修复方向对,eprintln! 是一个疏漏 |
| 跨平台 | Windows sparse 文件预分配是潜在 P0;现阶段因 engineAvailable 防护暂未触发 |
|
| 代码结构 | ✅ 良好 | 三文件分工清晰,无跨模块乱调 |
| 可观测性 | eprintln! 在生产包不可见,影响排查 |
|
| 向后兼容 | CHUNK_SIZE 变更会静默破坏旧 partial | |
| UI 破坏 | ✅ 无 | 移除 cancelled 样式分支是收缩性改动,不影响其他路径 |
四、合并建议
建议在合并前修复:
- 将
partial_actual_size里的eprintln!改为log::warn!(5 分钟改动)
建议后续跟进(不阻断合并):
2. Windows sparse 文件预分配——等 Windows 引擎就绪时必须处理
3. already_done_bytes 续传进度低估——视觉问题,不影响数据
4. .partial.idx 缺乏版本头——可在下一次大改时加
eprintln! → log::warn! 修复后,可以合并。
|
@claude 帮忙修复一下这些问题。 |
|
Claude finished @appergb's task in 6m 43s —— View job 审查问题修复完成(待 PR 作者应用)任务清单:
推送说明三处修改均已本地提交(commit 解决方法:@Hongbro886 直接将下方 patch 应用到你的 PR 分支即可: # 在 PR 分支根目录执行:
curl -s <此 comment 的 raw URL> | git am
# 或手动 cherry-pick 后 push已修复内容(文件:
|
User description
摘要
关于模型设置-模型下载进度条的若干修复
修复 / 新增 / 改进
修复下载模型区域点击后反应很慢的问题
PR Type
Bug fix, Enhancement
Description
Correct partial download byte count using chunk index
Improve cancel/retry progress state and optimistic UI
Remove cancelled phase styling and simplify progress visibility
Seed .partial.idx for sparse file consistency
Diagram Walkthrough
File Walkthrough
download.rs
Compute real partial size and enforce idx consistencyopenless-all/app/src-tauri/src/asr/local/download.rs
partial_actual_sizeto compute real downloaded bytes from.partial.idxchunk recordsdownload_one, ensure a.partial.idxfile is created for sparsepartial files to prevent misinterpretation
models.rs
Correct downloaded size calculation in walk_filesopenless-all/app/src-tauri/src/asr/local/models.rs
.partial.idxfiles when walking to sum downloaded sizespartial_actual_sizefor.partialfiles instead ofmeta.len()toget true bytes
LocalAsr.tsx
Fix cancel/retry progress state and remove cancelled UI phaseopenless-all/app/src/pages/LocalAsr.tsx
downloadedBytesand removeprogress entry