M4: dedicated opencode (Zen) provider

Adds a dedicated provider entry for opencode's Zen proxy on top of the existing OpenAI-compatible codec, with its own config wiring in harness-app and harness-core::config::load.
This commit is contained in:
2026-07-10 16:20:11 +02:00
parent 9ee5a1940d
commit e32f61e4f8
3 changed files with 64 additions and 3 deletions
+13
View File
@@ -147,6 +147,19 @@ impl EngineHandle {
};
providers.register(Arc::new(provider));
}
// OpenCode Zen: OpenAI-compatible chat gateway under its own `opencode` provider id,
// so it coexists with a real `openai` provider. `base_url` defaults to Zen's endpoint.
if let Some(key) = config
.providers
.get("opencode")
.and_then(|p| p.api_key.clone())
{
let base_url = config
.providers
.get("opencode")
.and_then(|p| p.base_url.clone());
providers.register(Arc::new(OpenAiProvider::opencode(key, base_url)));
}
Self::build(cwd, store, config, providers)
}