fix(cli): return actionable resource errors for fs commands#1458
Merged
MaojiaSheng merged 5 commits intovolcengine:mainfrom Apr 16, 2026
Merged
fix(cli): return actionable resource errors for fs commands#1458MaojiaSheng merged 5 commits intovolcengine:mainfrom
MaojiaSheng merged 5 commits intovolcengine:mainfrom
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
Collaborator
|
#1428 fixed this |
Contributor
Author
Collaborator
OK, thanks, and could you change the code after #1428, and fixes the conflicts |
…urce-error # Conflicts: # openviking/server/routers/filesystem.py
MaojiaSheng
approved these changes
Apr 16, 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.
Description
Fix the CLI/resource error UX for common filesystem states so
ov rm,ov abstract, andov overviewreturn actionable messages instead of generic internal server errors.This change keeps the existing command logic but improves how backend and router exceptions are translated and surfaced to users. It also preserves structured error codes in the Rust CLI output.
A follow-up test-only commit broadens the server-side regression suite across related filesystem/content endpoints.
Related Issue
Fixes #1457
Type of Change
Changes Made
openviking/server/error_mapping.py: add shared exception translation for AGFS/storage/runtime exceptions into structured OpenViking API errors.openviking/server/app.pyandopenviking/server/routers/filesystem.py: map unhandled filesystem errors to user-facingNOT_FOUND,FAILED_PRECONDITION,CONFLICT, andUNAVAILABLEresponses instead of generic 500s.openviking/storage/viking_fs.py: tightenrm,abstract, andoverviewbehavior so not-found, file-vs-directory misuse, backend failures, and non-recursive directory deletes are reported clearly and do not look like internal server bugs.crates/ov_cli/src/client.rsandcrates/ov_cli/src/error.rs: preserve structured server error codes in CLI output and remove the redundant genericAPI error:wrapping in the converted CLI message.crates/ov_cli/src/main.rs: clarify thatabstractandoverviewexpect a directory URI.tests/server/test_api_content.pyandtests/server/test_api_filesystem.py: add targeted regression coverage for missing resources, file-vs-directory misuse, resource-busy conflicts, backend unavailability, and directory deletion without--recursive.tests/server/test_api_fs_content_endpoint_suite.py: add broader endpoint coverage forfs/ls,fs/tree,fs/stat,fs/mkdir,fs/mv,content/read,content/download,content/write, andcontent/reindex.tests/server/test_server_health.pyandtests/server/test_error_scenarios.py: tighten existing not-found assertions from permissive404 or 500checks to strict structured404expectations.Testing
Validation run locally:
Result:
55 passedfor the expanded server test suitecargo check -p ov_clipassescargo fmt --check -p ov_clipassesChecklist
Screenshots (if applicable)
Not applicable.
Representative CLI behavior after the fix:
Additional Notes