Skip to content

feat(volcengine): add Volcano Engine (Doubao/Ark) provider support#892

Closed
dvrd wants to merge 15 commits intoRightNow-AI:mainfrom
dvrd:pr/873
Closed

feat(volcengine): add Volcano Engine (Doubao/Ark) provider support#892
dvrd wants to merge 15 commits intoRightNow-AI:mainfrom
dvrd:pr/873

Conversation

@dvrd
Copy link
Copy Markdown

@dvrd dvrd commented Mar 28, 2026

Summary

  • Adds volcengine and volcengine_coding providers backed by ByteDance's Ark API (ark.cn-beijing.volces.com)
  • Registers 4 Doubao chat models and 8 Ark coding/marketplace models in the model catalog
  • Wires provider into TUI init wizard, settings wizard, launcher, and welcome screen
  • Reuses the existing OpenAI-compatible driver (no new driver needed)

Changes

Core

  • openfang-types: VOLCENGINE_BASE_URL + VOLCENGINE_CODING_BASE_URL constants
  • openfang-runtime/drivers/mod.rs: provider defaults, known providers, auto-detect probe
  • openfang-runtime/model_catalog.rs: 12 models across two providers; ark/ namespace for Ark marketplace models to avoid ID collisions with native providers (minimax, zhipu, moonshot, deepseek)
  • openfang-runtime/agent_loop.rs: strip_provider_prefix strips ark/ catalog namespace before sending to Ark API (Ark expects bare model names on the wire)

TUI / CLI

  • init_wizard.rs + wizard.rs: both providers added with hints and correct env var
  • launcher.rs + welcome.rs: VOLCENGINE_API_KEY detection
  • main.rs: provider list, key validation, model fetch

Bug fixes caught during review

  • Duplicate model IDs resolved via ark/ canonical namespace
  • Empty env var guard (!v.is_empty()) applied consistently
  • volcengine_coding removed from auto-detect probe (shares key with volcengine; coding plan must be chosen explicitly)
  • ark/ stripping gated to volcengine providers only (not unconditional)
  • Pre-existing env var mismatches fixed: Qwen (DASHSCOPE_API_KEY), HuggingFace (HF_API_KEY), Replicate (REPLICATE_API_TOKEN), Cohere (COHERE_API_KEY)

Tests

  • test_provider_defaults_volcengine / test_provider_defaults_volcengine_coding
  • test_ark_alias_resolution — verifies ark/minimax-m2.5 etc. resolve correctly
  • test_doubao_alias_resolves_to_volcengine_model
  • test_strip_ark_catalog_prefix_for_volcengine_coding + negative case for non-volcengine providers

Closes #873

gaoyiman and others added 15 commits March 28, 2026 18:37
添加火山引擎(Doubao)和火山引擎编码计划作为新的AI提供商支持,包括:
- 在多个文件中添加VOLCENGINE_API_KEY环境变量配置
- 添加volcengine和volcengine_coding提供商信息
- 更新模型目录添加火山引擎相关模型
更新模型目录中的火山引擎编码计划模型,增加新模型并调整现有模型的参数
将火山引擎相关配置移至列表更靠前的位置,并确保其配置完整
…vider

Updated the display name for the Volcano Engine provider across multiple files to remove the "(Doubao)" suffix for consistency.
- Rename doubao-seed-code under volcengine_coding provider to
  doubao-seed-code-ark to eliminate ambiguous model ID lookup
- Add comment marking third-party Ark marketplace models in catalog
- Guard empty env vars in launcher.rs and welcome.rs detect_provider()
  using .ok().filter(|v| !v.is_empty()).is_some() instead of .is_ok()
- Add volcengine and volcengine_coding to unknown-provider error message

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… provider tests

- Prefix ark-marketplace models with "ark/" to avoid ID collision with
  native minimax, zhipu, and moonshot provider entries (FIX 1)
- Add comment explaining dot vs hyphen separator difference between
  volcengine_coding (coding/v3) and volcengine (v3) endpoints (FIX 2)
- Include "doubao" alias in unknown-provider error message (FIX 3)
- Add "volcengine" probe to detect_available_provider() (FIX 4)
- Add test_provider_defaults_volcengine, _doubao_alias, and
  _volcengine_coding tests (FIX 5)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add display field to ProviderInfo in wizard.rs; all providers now show
  human-readable names (e.g. "Volcano Engine" / "Volcano Engine (Coding)")
  instead of raw identifiers
- Swap volcengine/volcengine_coding order to match init_wizard.rs and catalog
- Document "doubao" dual-alias intent in runtime model_catalog.rs
- Document cn-beijing regional hardcoding with base_url override note
- Document zero pricing for Ark-routed third-party models

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…as comment

- Swap volcengine/volcengine_coding probe order in detect_available_provider so
  the general volcengine provider is auto-selected when VOLCENGINE_API_KEY is set
- Align volcengine_coding display name to "Volcano Engine (Coding Plan)" in both
  init_wizard.rs and wizard.rs
- Add sync-warning comment on the doubao alias in model_catalog.rs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… and add wizard hints

volcengine_coding shares the same VOLCENGINE_API_KEY as volcengine, making it
permanently unreachable in auto-detection. Remove it from PROBE_ORDER so only
volcengine is auto-detected; volcengine_coding remains selectable via the wizard.

Also add descriptive hints for both volcengine entries in the init wizard
("ByteDance Ark platform" / "ByteDance Ark — coding models").

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… fix provider order

Move ark/ prefix to aliases so catalog lookups still resolve but the
bare model name is forwarded to the Ark API (which rejects the prefix).
Also reorder volcengine before volcengine_coding in provider_list().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
strip_provider_prefix now removes the ark/ prefix so that model IDs
like ark/minimax-m2.5 are sent as minimax-m2.5 to the Ark API.
Also extends test_ark_alias_resolution to cover find_model paths.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previously strip_provider_prefix stripped the ark/ prefix for all
providers, which could corrupt model IDs from other providers. Now
the strip only fires when provider is "volcengine" or "volcengine_coding".

Also adds two unit tests verifying the guarded and unguarded cases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tend tests

- Add "doubao" to the ark/ prefix strip condition in agent_loop.rs so
  users with provider = "doubao" get correct model IDs sent to the API
- Add two new tests: volcengine and doubao ark/ stripping
- Update volcengine wizard hints with region info (cn-beijing)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The four Ark marketplace models under volcengine_coding had bare IDs
(minimax-m2.5, glm-4.7, deepseek-v3.2, kimi-k2.5) that collided with
native provider entries. Since find_model does a linear scan returning
the first match, ark/ lookups were resolving to the wrong provider.

Fix: make ark/ the canonical ID for each colliding entry, keeping the
bare name as an alias only for deepseek-v3.2 (no collision exists there).
Update test_ark_alias_resolution to assert on the new canonical ark/ IDs
and verify native provider entries remain unaffected.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dvrd
Copy link
Copy Markdown
Author

dvrd commented Mar 28, 2026

Closing — PR should target dvrd/openfang instead.

@dvrd dvrd closed this Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants