Skip to content

[Question]: now ov and openviking CLI directly sends relative path to server to resolve #230

@ZaynJarvis

Description

@ZaynJarvis

Your Question

shall i

  1. update both CLIs to resolve relative path to absolute path first, then send to server?
  2. 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.pyopenviking_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 locationopenviking_cli/cli/commands/resources.py:
  from pathlib import Path

  data_path = Path(data)
  if data_path.exists():
      data = str(data_path.resolve())

  Rust fix locationcrates/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

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions