fix(api): complete parts support in SDK layers and simplify error handling#275
Merged
qin-ctx merged 1 commit intovolcengine:mainfrom Feb 25, 2026
Merged
Conversation
1. Complete parts support in all client layers:
- BaseClient (abstract interface)
- SyncHTTPClient
- AsyncOpenViking
- SyncOpenViking
2. Simplify VikingFS error handling:
- Remove _convert_agfs_error() complex error mapping
- Use simple FileNotFoundError for all AGFS exceptions
- This is cleaner and the original PR's error mapping was
over-engineered for the use case
qin-ctx
approved these changes
Feb 25, 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.
Complete parts support in all client layers:
Simplify VikingFS error handling:
Description
This PR completes the
partsparameter support that was partially implemented in #270. The previous PR addedpartssupport to HTTP API and some client layers, but missed the SDK entry points (AsyncOpenViking,SyncOpenViking) and base interface (BaseClient).Additionally, this PR removes the over-engineered
_convert_agfs_error()function that was introduced in #270, replacing it with simpleFileNotFoundErrorexceptions. The complex error type mapping (FileNotFoundError/PermissionError/IOError) was unnecessary for the use case and added complexity without meaningful benefit.Related Issue
Follow-up to #270
Type of Change
Changes Made
partsparameter toBaseClient.add_message()abstract interfacepartsparameter toSyncHTTPClient.add_message()partsparameter toAsyncOpenViking.add_message()partsparameter toSyncOpenViking.add_message()_convert_agfs_error()method fromVikingFSread_file(),read_file_bytes(), andls()to useFileNotFoundErrorTesting
Checklist
Additional Notes
The
partsparameter in alladd_message()methods follows the same pattern:content: str | None = None- simple text mode (backward compatible)parts: list[dict] | None = None- full Part support (TextPart, ContextPart, ToolPart)partstakes precedencecontentorpartsmust be provided