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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user