-
Notifications
You must be signed in to change notification settings - Fork 283
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
Your Question
shall i
- update both CLIs to resolve relative path to absolute path first, then send to server?
- and in future with file upload, upload file to server first, get the temp server file path, then send to server?
Context
No response
Code Example (Optional)
Python CLI (openviking_cli/cli/commands/resources.py → openviking_cli/client/http.py):
# resources.py — passes data as-is
lambda client: client.add_skill(data=data, ...)
# http.py — sends raw string to server
json={"data": data, ...}
Rust CLI (crates/ov_cli/src/client.rs):
// sends raw string to server
"data": data,
Both send the raw relative path string. The server then does Path("./searching-context") which
resolves relative to the server's CWD, not the caller's.
The fix belongs in the command layer (add_skill_command in Python, add_skill command in Rust),
resolving to absolute before sending:
Python fix location — openviking_cli/cli/commands/resources.py:
from pathlib import Path
data_path = Path(data)
if data_path.exists():
data = str(data_path.resolve())
Rust fix location — crates/ov_cli/src/commands/resources.rs:
let resolved = std::path::Path::new(data);
let data = if resolved.exists() {
std::fs::canonicalize(resolved)
.map(|p| p.to_string_lossy().into_owned())
.unwrap_or_else(|_| data.to_owned())
} else {
data.to_owned()
};Related Area
None
Before Asking
- I have checked the documentation
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested
Type
Projects
Status
Done