feat: add Volcengine provider with DeepSeek-V4-Pro/Flash support#1993
feat: add Volcengine provider with DeepSeek-V4-Pro/Flash support#1993dzyuan wants to merge 2 commits into
Conversation
Add a new Volcengine (Volcano Engine Ark) provider for accessing DeepSeek-V4-Pro and DeepSeek-V4-Flash via the Volcengine Coding API. Changes: - Add ProviderKind::Volcengine to config crate with default base_url pointing to Volcengine Coding API (api/coding/v3) - Add DeepSeek-V4-Pro and DeepSeek-V4-Flash models to the agent model registry under Volcengine provider - Add ApiProvider::Volcengine to TUI with full picker/dropdown support - Wire up CLI --provider, config get/set/unset, and secrets resolution - Add environment variable aliases: VOLCENGINE_API_KEY, ARK_API_KEY - Ignore local dev scripts (*.cmd, backup/)
There was a problem hiding this comment.
Code Review
This pull request introduces support for the Volcengine (Volcano Engine Ark) provider across the agent, CLI, and TUI crates. Key changes include adding Volcengine to the model registry, configuration structures, and environment variable mappings, as well as updating the TUI to support Volcengine authentication and model selection. Feedback highlights a critical issue where Volcengine was incorrectly categorized as a provider not requiring authentication, which would lead to authorization failures. Additionally, reviewers noted potential issues with model aliasing for reasoning models, unnecessary cross-contamination of environment variables between providers, and minor inconsistencies in CLI output messages and configuration key ordering.
| // Self-hosted deployments commonly run without auth on localhost. | ||
| // Return an empty key and let the client omit the Authorization header. | ||
| ApiProvider::Sglang | ApiProvider::Vllm | ApiProvider::Ollama => Ok(String::new()), | ||
| ApiProvider::Sglang | ApiProvider::Vllm | ApiProvider::Ollama | ApiProvider::Volcengine => Ok(String::new()), |
There was a problem hiding this comment.
Volcengine (Volcano Engine Ark) is a cloud provider that requires authentication. Including it in this list—which is intended for self-hosted or local deployments that run without authentication—will cause the client to omit the Authorization header, resulting in authentication failures.
ApiProvider::Sglang | ApiProvider::Vllm | ApiProvider::Ollama => Ok(String::new()),| aliases: vec![ | ||
| "deepseek-v4-flash".to_string(), | ||
| "deepseek-chat".to_string(), | ||
| "deepseek-reasoner".to_string(), |
There was a problem hiding this comment.
| if resolved_runtime.provider == ProviderKind::WanjieArk || resolved_runtime.provider == ProviderKind::Volcengine { | ||
| cmd.env("VOLCENGINE_API_KEY", api_key); | ||
| cmd.env("WANJIE_ARK_API_KEY", api_key); | ||
| } |
There was a problem hiding this comment.
The environment variables for WanjieArk and Volcengine are being set regardless of which provider is active. This cross-contamination is unnecessary and could lead to confusion. Each provider should only have its own relevant environment variables set.
if resolved_runtime.provider == ProviderKind::WanjieArk {
cmd.env("WANJIE_ARK_API_KEY", api_key);
}
if resolved_runtime.provider == ProviderKind::Volcengine {
cmd.env("VOLCENGINE_API_KEY", api_key);
}| if resolved_runtime.provider == ProviderKind::WanjieArk || resolved_runtime.provider == ProviderKind::Volcengine { | ||
| cmd.env("VOLCENGINE_API_KEY", api_key); | ||
| cmd.env("WANJIE_ARK_API_KEY", api_key); | ||
| } |
There was a problem hiding this comment.
Similar to the previous block, environment variables for WanjieArk and Volcengine are being set for both providers. These should be separated to avoid leaking keys into unrelated environment variables.
if resolved_runtime.provider == ProviderKind::WanjieArk {
cmd.env("WANJIE_ARK_API_KEY", api_key);
}
if resolved_runtime.provider == ProviderKind::Volcengine {
cmd.env("VOLCENGINE_API_KEY", api_key);
}| "providers.wanjie_ark.api_key" => self.providers.wanjie_ark.api_key.clone(), | ||
| "providers.volcengine.api_key" => self.providers.volcengine.api_key.clone(), | ||
| "providers.wanjie_ark.base_url" => self.providers.wanjie_ark.base_url.clone(), | ||
| "providers.volcengine.base_url" => self.providers.volcengine.base_url.clone(), | ||
| "providers.wanjie_ark.model" => self.providers.wanjie_ark.model.clone(), | ||
| "providers.volcengine.model" => self.providers.volcengine.model.clone(), |
There was a problem hiding this comment.
The configuration keys for wanjie_ark and volcengine are interleaved. Grouping them by provider improves readability and maintainability.
| "providers.wanjie_ark.api_key" => self.providers.wanjie_ark.api_key.clone(), | |
| "providers.volcengine.api_key" => self.providers.volcengine.api_key.clone(), | |
| "providers.wanjie_ark.base_url" => self.providers.wanjie_ark.base_url.clone(), | |
| "providers.volcengine.base_url" => self.providers.volcengine.base_url.clone(), | |
| "providers.wanjie_ark.model" => self.providers.wanjie_ark.model.clone(), | |
| "providers.volcengine.model" => self.providers.volcengine.model.clone(), | |
| "providers.wanjie_ark.api_key" => self.providers.wanjie_ark.api_key.clone(), | |
| "providers.wanjie_ark.base_url" => self.providers.wanjie_ark.base_url.clone(), | |
| "providers.wanjie_ark.model" => self.providers.wanjie_ark.model.clone(), | |
| "providers.volcengine.api_key" => self.providers.volcengine.api_key.clone(), | |
| "providers.volcengine.base_url" => self.providers.volcengine.base_url.clone(), | |
| "providers.volcengine.model" => self.providers.volcengine.model.clone(), |
| ("OLLAMA_API_KEY", "codewhale auth set --provider ollama") | ||
| } | ||
| crate::config::ApiProvider::Volcengine => { | ||
| ("VOLCENGINE_API_KEY", "deepseek auth set --provider volcengine") |
There was a problem hiding this comment.
…gine - Remove Volcengine from reasoning_effort 'off' no-auth group (HIGH) - Add Volcengine to proper reasoning_effort handling (like DeepSeek) - Remove 'deepseek-reasoner' alias from DeepSeek-V4-Flash (MEDIUM) - Separate WanjieArk and Volcengine env vars in CLI (MEDIUM) - Group config keys by provider for readability (MEDIUM) - Use 'codewhale' instead of 'deepseek' in login hints (MEDIUM) - Enable cache_telemetry_supported for Volcengine provider
Add Volcengine (Volcano Engine Ark) provider for DeepSeek-V4-Pro/Flash via Coding API.