Skip to content

fix: expand tilde (~) in storage workspace paths#725

Merged
qin-ctx merged 1 commit intovolcengine:mainfrom
ZaynJarvis:fix/config-tilde-expansion
Mar 18, 2026
Merged

fix: expand tilde (~) in storage workspace paths#725
qin-ctx merged 1 commit intovolcengine:mainfrom
ZaynJarvis:fix/config-tilde-expansion

Conversation

@ZaynJarvis
Copy link
Copy Markdown
Collaborator

This PR fixes an issue where tilde expansion (~) doesn't work properly in the ov.conf storage workspace configuration.

Problem:
When configuring storage workspace as "/.openviking/data" in ov.conf, the path was treated literally instead of expanding ~ to the user's home directory. This caused the application to create directories named "" instead of using the actual home directory.

Root Cause:
The storage configuration code was using Path(workspace).resolve() without first calling expanduser() to handle the ~ character.

Solution:

  • Added .expanduser() before .resolve() in storage_config.py's resolve_paths() method
  • Added .expanduser() before .resolve() in open_viking_config.py's initialize_openviking_config() function
  • Added .expanduser() before .resolve() in storage_config.py's get_upload_temp_dir() method for consistency

Files Changed:

  • openviking_cli/utils/config/storage_config.py
  • openviking_cli/utils/config/open_viking_config.py

Testing:
The fix ensures that workspace paths like "~/.openviking/data" are properly expanded to "/Users/username/.openviking/data" before being resolved and used.

- Fix storage config to properly expand ~ to home directory
- Add expanduser() before resolve() in storage_config.py and open_viking_config.py
- Resolves issue where workspace: "~/.openviking/data" was treated as literal path
- Ensures consistent behavior with other OpenViking config file resolution
@qin-ctx qin-ctx merged commit 1d6afdd into volcengine:main Mar 18, 2026
6 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenViking project Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants