From 95d29be8a683ea190b62c6f39f4740e6364e197e Mon Sep 17 00:00:00 2001 From: Evan Date: Mon, 27 Apr 2026 15:12:14 +0900 Subject: [PATCH] feat(providers): split _coding api_key_env from main provider (#82) Each `_coding` provider entry previously declared the same `api_key_env` as its standard counterpart, causing one credential to silently activate two providers. Users who only signed up for the per-token API endpoint saw the Coding Plan endpoint's models mixed into their model picker without intent. Rename so each pair uses an independent env var: byteplus-coding BYTEPLUS_API_KEY -> BYTEPLUS_CODING_API_KEY volcengine-coding VOLCENGINE_API_KEY -> VOLCENGINE_CODING_API_KEY zai-coding ZHIPU_API_KEY -> ZAI_CODING_API_KEY zhipu-coding ZHIPU_API_KEY -> ZHIPU_CODING_API_KEY This is a breaking change: existing users must set the new env vars. The librefang daemon will be updated separately to recognize the old env vars as a deprecated fallback during a migration window. See librefang/librefang#3278 for the design discussion and rollout plan. Out of scope (different problem class, tracked in the same issue): - zai/zhipu cross-region key sharing (both still share ZHIPU_API_KEY) - github-copilot/microsoft cross-product GITHUB_TOKEN reuse Refs librefang/librefang#3278 --- providers/byteplus-coding.toml | 2 +- providers/volcengine-coding.toml | 2 +- providers/zai-coding.toml | 2 +- providers/zhipu-coding.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/providers/byteplus-coding.toml b/providers/byteplus-coding.toml index 5b828cc..3add242 100644 --- a/providers/byteplus-coding.toml +++ b/providers/byteplus-coding.toml @@ -21,7 +21,7 @@ [provider] id = "byteplus_coding" display_name = "BytePlus ModelArk Coding Plan" -api_key_env = "BYTEPLUS_API_KEY" +api_key_env = "BYTEPLUS_CODING_API_KEY" base_url = "https://ark.ap-southeast.bytepluses.com/api/coding" key_required = true diff --git a/providers/volcengine-coding.toml b/providers/volcengine-coding.toml index c0cda0b..e7c815f 100644 --- a/providers/volcengine-coding.toml +++ b/providers/volcengine-coding.toml @@ -4,6 +4,6 @@ [provider] id = "volcengine_coding" display_name = "Volcano Engine Coding Plan" -api_key_env = "VOLCENGINE_API_KEY" +api_key_env = "VOLCENGINE_CODING_API_KEY" base_url = "https://ark.cn-beijing.volces.com/api/coding/v3" key_required = true diff --git a/providers/zai-coding.toml b/providers/zai-coding.toml index b7190bc..09884e1 100644 --- a/providers/zai-coding.toml +++ b/providers/zai-coding.toml @@ -4,7 +4,7 @@ [provider] id = "zai_coding" display_name = "Z.AI Coding" -api_key_env = "ZHIPU_API_KEY" +api_key_env = "ZAI_CODING_API_KEY" base_url = "https://api.z.ai/api/coding/paas/v4" key_required = true diff --git a/providers/zhipu-coding.toml b/providers/zhipu-coding.toml index a9b230f..070731e 100644 --- a/providers/zhipu-coding.toml +++ b/providers/zhipu-coding.toml @@ -4,7 +4,7 @@ [provider] id = "zhipu_coding" display_name = "Zhipu Coding (CodeGeeX)" -api_key_env = "ZHIPU_API_KEY" +api_key_env = "ZHIPU_CODING_API_KEY" base_url = "https://open.bigmodel.cn/api/coding/paas/v4" key_required = true