feat(claw): discover OpenCode credentials

This commit is contained in:
vhaudiquet committed 2026-11-09 23:32:18 +01:00
1 parent fa0e3d4470
commit 8e76d26c5e
1 file changed
+3
+3
View File
@@ -318,6 +318,7 @@ fn env_vars_for(kind: &str) -> &'static [&'static str] {
"openrouter" => &["OPENROUTER_API_KEY"], "openrouter" => &["OPENROUTER_API_KEY"],
"deepseek" => &["DEEPSEEK_API_KEY"], "deepseek" => &["DEEPSEEK_API_KEY"],
"zai" => &["ZAI_API_KEY", "Z_AI_API_KEY"], "zai" => &["ZAI_API_KEY", "Z_AI_API_KEY"],
"opencode" => &["OPENCODE_API_KEY"],
"copilot" => &["GITHUB_COPILOT_TOKEN"], "copilot" => &["GITHUB_COPILOT_TOKEN"],
_ => &[], _ => &[],
} }
@@ -369,6 +370,7 @@ pub fn addable_kinds() -> &'static [&'static str] {
"google", "google",
"llama-cpp", "llama-cpp",
"openai", "openai",
"opencode",
"openrouter", "openrouter",
"zai", "zai",
] ]
@@ -508,6 +510,7 @@ pub fn discover(
"openrouter", "openrouter",
"deepseek", "deepseek",
"zai", "zai",
"opencode",
"copilot", "copilot",
] { ] {
let stored_of_kind = rows.iter().any(|(_, params)| params.kind == kind); let stored_of_kind = rows.iter().any(|(_, params)| params.kind == kind);