Repository navigation
fix(tui): 删除模型 profile 未找到文件时给出提示 - #359
Open
openjiuwen-sync-bot[bot] wants to merge 1 commit into
Open
openjiuwen-sync-bot[bot] wants to merge 1 commit into
openjiuwen-sync-bot[bot] wants to merge 1 commit into
Conversation
|
zxy12_zxy seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Contributor
|
head_sha: 变更摘要本次变更修复了 TUI 模型配置界面在删除模型 profile 时的反馈缺失问题: 主要改动
|
Contributor
|
head_sha: 代码审查✅ 未发现问题 |
Contributor
The models screen discarded delete_profile()'s return value, so deleting a stale entry whose YAML was already gone looked like an ordinary success. Capture the result and show a warning toast when the file was not on disk, while still removing the stale entry and reconciling the pointers as before. Signed-off-by: zxy12_zxy <419500457@qq.com>
openjiuwenai
force-pushed
the
sync/pr-254
branch
from
November 27, 2026 03:48
8f409c0 to
66df19d
Compare
Contributor
This branch has not been deployed
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.
Paired: GitHub #359 ↔ GitCode !254
问题
模型配置界面的
_do_delete()直接丢弃delete_profile()的返回值。当列表中残留的 profile 在磁盘上已没有对应 YAML(例如被外部删除)时,删除操作看起来与正常成功完全一样,用户无法得知磁盘上其实没有任何文件被删除。修复
delete_profile()的返回值,为False时弹出 warning 提示,说明磁盘上未找到文件、仅移除了列表中的残留条目。tests/app/tui/screens/test_model_config.py新增两个用例:文件缺失时产生 warning 且残留条目被移除;正常删除成功时不得产生 warning。验证
ruff check/ruff format --check通过pytest tests/app/tui/screens/test_model_config.py50 passed