Merged
Conversation
add-resource/add-skill 添加单个文件到远程 server 时,之前只处理了目录场景 (zip后上传),单文件直接传本地路径导致 server 端报 Path does not exist。 现在对 Python HTTP client 和 Rust CLI client 的 add_resource/add_skill 方法 均增加 is_file() 分支,单文件直接通过 _upload_temp_file 上传。 附带修复: - Rust CLI config 支持 OPENVIKING_CLI_CONFIG_FILE 环境变量(与 Python 侧一致) - Rust CLI add-resource --timeout 改为可选参数(仅配合 --wait 使用) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
zhoujh01
approved these changes
Feb 28, 2026
|
|
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.
关联 Issue
Closes #331
变更说明
openviking_cli/client/http.py):add_resource和add_skill增加is_file()分支,单文件直接通过_upload_temp_file上传到远程 servercrates/ov_cli/src/client.rs): 同上,增加单文件上传分支crates/ov_cli/src/config.rs): 支持OPENVIKING_CLI_CONFIG_FILE环境变量,与 Python 侧保持一致crates/ov_cli/src/main.rs):add-resource --timeout改为可选参数(仅配合--wait使用)问题原因
当 client 和 server 部署在不同机器上时,
add-resource添加单个文件会报Path xxx does not exist。原因是 client 只把本地文件路径字符串传给了 server,server 在自己的文件系统上找不到该路径。添加目录时没有这个问题,因为目录场景已经实现了"先 zip 上传再传 temp_path"的逻辑。单文件只需复用同样的上传机制。
修改逻辑
将原有
exists() and is_dir()判断拆分为三级:temp_path接收Server 端无需修改,
temp_upload端点已支持接收任意文件。测试计划
add-resource单文件成功add-skill单文件成功add-resource单文件成功add-skill单文件成功OPENVIKING_CLI_CONFIG_FILE环境变量生效--timeout不传时不报错🤖 Generated with Claude Code