Skip to content

fix: support short-format URI paths in VikingURI and VikingFS#301

Closed
fengjunhui wants to merge 1 commit intovolcengine:mainfrom
fengjunhui:fix/uri-short-format-parsing
Closed

fix: support short-format URI paths in VikingURI and VikingFS#301
fengjunhui wants to merge 1 commit intovolcengine:mainfrom
fengjunhui:fix/uri-short-format-parsing

Conversation

@fengjunhui
Copy link

Summary

Fixes #259

  • Auto-normalize short-format URIs (e.g., /resources, user/memories) to full viking:// format in VikingURI.__init__, leveraging the existing VikingURI.normalize() method
  • Add URI normalization in VikingFS._is_accessible() so access checks no longer reject valid short-format paths
  • Add 11 unit tests covering short-format URI parsing and normalization

Changes

File Change
openviking_cli/utils/uri.py Call normalize() in __init__ before parsing
openviking/storage/viking_fs.py Call VikingURI.normalize() in _is_accessible()
tests/test_uri_short_format.py New: 11 tests for short-format URI support

Test plan

  • VikingURI("/resources")viking://resources (was ValueError)
  • VikingURI("user/memories")viking://user/memories (was ValueError)
  • VikingURI("viking://resources") unchanged (no regression)
  • Invalid scope still raises ValueError
  • client.ls("/resources") works end-to-end (was PermissionError)
  • All 11 new unit tests pass

🤖 Generated with Claude Code

…gine#259)

Auto-normalize short-format URIs (e.g., '/resources', 'user/memories')
to full 'viking://' format, so callers don't need to always use the
verbose prefix.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


冯俊辉 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.

@fengjunhui
Copy link
Author

Closing in favor of #281 which already addresses this issue with a more comprehensive fix. Thanks!

@fengjunhui fengjunhui closed this Feb 26, 2026
@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenViking project Feb 26, 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.

Bug: URI parsing fails for short format paths (e.g., '/resources' instead of 'viking://resources')

2 participants