Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src-tauri/src/services/coding_plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ enum CodingPlanProvider {
MiniMaxEn,
ZenMux,
/// 火山方舟 Agent Plan / Coding Plan(base_url 形如
/// `https://ark.cn-beijing.volces.com/api/coding[/v3]`)。
/// `https://ark.cn-beijing.volces.com/api/{coding,plan}[/v3]`)。
Volcengine,
}

Expand All @@ -36,7 +36,7 @@ fn detect_provider(base_url: &str) -> Option<CodingPlanProvider> {
Some(CodingPlanProvider::MiniMaxEn)
} else if url.contains("zenmux") {
Some(CodingPlanProvider::ZenMux)
} else if url.contains("volces.com/api/coding") {
} else if url.contains("volces.com/api/coding") || url.contains("volces.com/api/plan") {
// 仅匹配 Coding/Agent Plan 入口;DouBaoSeed 按量付费走 /api/v3 与
// /api/compatible,没有套餐额度,不在此命中。
Some(CodingPlanProvider::Volcengine)
Expand Down
2 changes: 1 addition & 1 deletion src/config/claudeDesktopProviderPresets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export const claudeDesktopProviderPresets: ClaudeDesktopProviderPreset[] = [
apiKeyUrl:
"https://www.volcengine.com/activity/codingplan?ac=MMAP8JTTCAQ2&rc=6J6FV5N2&utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
category: "cn_official",
baseUrl: "https://ark.cn-beijing.volces.com/api/coding",
baseUrl: "https://ark.cn-beijing.volces.com/api/plan",
mode: "proxy",
apiFormat: "anthropic",
modelRoutes: brandedRoutes(
Expand Down
2 changes: 1 addition & 1 deletion src/config/claudeProviderPresets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export const providerPresets: ProviderPreset[] = [
"https://www.volcengine.com/activity/codingplan?ac=MMAP8JTTCAQ2&rc=6J6FV5N2&utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
settingsConfig: {
env: {
ANTHROPIC_BASE_URL: "https://ark.cn-beijing.volces.com/api/coding",
ANTHROPIC_BASE_URL: "https://ark.cn-beijing.volces.com/api/plan",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Accept the new Volcengine plan path in usage detection

When this preset is added or queried with the new /api/plan base URL, the token-plan plumbing no longer recognizes it as Volcengine: the frontend detector in src/config/codingPlanProviders.ts and the backend detect_provider in src-tauri/src/services/coding_plan.rs still match only volces.com/api/coding. That means the Claude preset will not auto-inject the token_plan usage script, and any existing/manual Volcengine usage query with this new default returns Unknown coding plan provider; please update the detectors to accept the new plan path as well.

Useful? React with 👍 / 👎.

ANTHROPIC_AUTH_TOKEN: "",
ANTHROPIC_MODEL: "ark-code-latest",
ANTHROPIC_DEFAULT_HAIKU_MODEL: "ark-code-latest",
Expand Down
4 changes: 2 additions & 2 deletions src/config/codexProviderPresets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ export const codexProviderPresets: CodexProviderPreset[] = [
auth: generateThirdPartyAuth(""),
config: generateThirdPartyConfig(
"ark_agentplan",
"https://ark.cn-beijing.volces.com/api/coding/v3",
"https://ark.cn-beijing.volces.com/api/plan/v3",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update the stale Codex preset test fixture

This URL change leaves tests/config/codexChatProviderPresets.test.ts expecting the old /api/coding/v3 value for 火山Agentplan. I ran pnpm vitest run tests/config/codexChatProviderPresets.test.ts, and it fails at the base URL assertion with expected https://ark.cn-beijing.volces.com/api/coding/v3 but received https://ark.cn-beijing.volces.com/api/plan/v3, so the targeted Vitest suite/CI remains red until that fixture is updated.

Useful? React with 👍 / 👎.

"ark-code-latest",
),
endpointCandidates: ["https://ark.cn-beijing.volces.com/api/coding/v3"],
endpointCandidates: ["https://ark.cn-beijing.volces.com/api/plan/v3"],
apiFormat: "openai_chat",
modelCatalog: modelCatalog([
{
Expand Down
6 changes: 3 additions & 3 deletions src/config/codingPlanProviders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ export const CODING_PLAN_PROVIDERS: readonly CodingPlanProviderEntry[] = [
},
{
// 火山方舟 Agent Plan / Coding Plan。base_url 形如
// ark.cn-beijing.volces.com/api/coding[/v3];与后端 detect_provider 的
// `volces.com/api/coding` 子串判断同效。
// ark.cn-beijing.volces.com/api/{coding,plan}[/v3];与后端 detect_provider 的
// `volces.com/api/coding` 和 `volces.com/api/plan` 子串判断同效。
id: "volcengine",
label: "火山方舟 (Volcengine)",
pattern: /volces\.com\/api\/coding/i,
pattern: /volces\.com\/api\/(coding|plan)/i,
},
] as const;

Expand Down
2 changes: 1 addition & 1 deletion src/config/hermesProviderPresets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export const hermesProviderPresets: HermesProviderPreset[] = [
"https://www.volcengine.com/activity/codingplan?ac=MMAP8JTTCAQ2&rc=6J6FV5N2&utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
settingsConfig: {
name: "ark_agentplan",
base_url: "https://ark.cn-beijing.volces.com/api/coding",
base_url: "https://ark.cn-beijing.volces.com/api/plan",
api_key: "",
api_mode: "anthropic_messages",
models: [
Expand Down
2 changes: 1 addition & 1 deletion src/config/openclawProviderPresets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export const openclawProviderPresets: OpenClawProviderPreset[] = [
apiKeyUrl:
"https://www.volcengine.com/activity/codingplan?ac=MMAP8JTTCAQ2&rc=6J6FV5N2&utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch",
settingsConfig: {
baseUrl: "https://ark.cn-beijing.volces.com/api/coding/v3",
baseUrl: "https://ark.cn-beijing.volces.com/api/plan/v3",
apiKey: "",
api: "openai-completions",
models: [
Expand Down
2 changes: 1 addition & 1 deletion src/config/opencodeProviderPresets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ export const opencodeProviderPresets: OpenCodeProviderPreset[] = [
npm: "@ai-sdk/openai-compatible",
name: "火山Agentplan",
options: {
baseURL: "https://ark.cn-beijing.volces.com/api/coding/v3",
baseURL: "https://ark.cn-beijing.volces.com/api/plan/v3",
apiKey: "",
setCacheKey: true,
},
Expand Down
2 changes: 1 addition & 1 deletion tests/config/codexChatProviderPresets.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const expectedChatPresets = new Map<
[
"火山Agentplan",
{
baseUrl: "https://ark.cn-beijing.volces.com/api/coding/v3",
baseUrl: "https://ark.cn-beijing.volces.com/api/plan/v3",
contextWindows: { "ark-code-latest": 256000 },
},
],
Expand Down