feat: support Ark context management and reliable inline-image tracing#667
Merged
yaozheng-fang merged 3 commits intoJul 17, 2026
Conversation
zakahan
force-pushed
the
feat/responses-context-and-inline-image-tracing
branch
from
July 16, 2026 03:33
22a1f7a to
4eeaa52
Compare
yaozheng-fang
approved these changes
Jul 17, 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.
Summary
This PR adds two complementary improvements for Ark Responses workloads and multimodal observability:
context_managementconfiguration through VeADK without filtering it out.Ark Responses context management
VeADK already accepts provider-specific options through
Agent.model_extra_config, butrequest_reorganization_by_ark()filters the final Ark request throughark_supported_fields. Becausecontext_managementwas not in that allowlist, valid user configuration was removed before reaching the Ark SDK.This PR:
context_managementto the Ark request allowlist.clear_thinkingandclear_tool_usespolicies.Agentforwards the configuration to an Ark Responses model.volcengine-python-sdkversion to5.0.36, the first version with formal Responses context-management request types and request serialization support.No context-management policy is enabled by default. Applications remain responsible for selecting supported models and configuring edit policies through
model_extra_config.Example:
Inline-image TOS observability
When
upload_inline_data_to_tosis enabled, VeADK uploads inline media before the model call and stores a signed TOS URL ininline_data.display_namefor tracing. The previous default constructor argument always suppliedveadk-default-bucket, which preventedDATABASE_TOS_BUCKETfrom selecting an application-owned bucket. The upload API also returned no status, so the runner could assign a signed URL without knowing whether the object had actually been stored.This PR:
bucket_nameargument.DATABASE_TOS_BUCKET.DEFAULT_TOS_BUCKET_NAME.VOLCENGINE_SESSION_TOKENwhen no explicit session token is supplied.async_upload_bytes()to returnTrueonly afterput_objectsucceeds andFalsewhen bucket preparation or upload fails.Explicit constructor values continue to take precedence over environment configuration. The existing signed-URL format and expiration behavior are unchanged.
Tests
Added regression coverage for:
context_management.Validation: