harness-providers + app: dedicated opencode (Zen) provider

OpenAiProvider gains a custom id and a chat-only mode; `OpenAiProvider::opencode`
builds an OpenCode Zen provider (id `opencode`, defaults to Zen's gateway, always
chat-completions so even gpt-*/o* model ids route correctly). Registered from a
`providers.opencode` config block / OPENCODE_API_KEY env, so it coexists with a
real `openai` provider. Models are referenced as `opencode/<model>`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-09 06:59:46 +02:00
co-authored by Claude Opus 4.8
parent 7738ed55b9
commit 230e828b81
3 changed files with 64 additions and 3 deletions
+1
View File
@@ -29,6 +29,7 @@ const ENV_CONFIG_PATH: &str = "AI_HARNESS_CONFIG";
const PROVIDER_ENV_KEYS: &[(&str, &str)] = &[
("anthropic", "ANTHROPIC_API_KEY"),
("openai", "OPENAI_API_KEY"),
("opencode", "OPENCODE_API_KEY"),
];
fn read_jsonc(path: &Path) -> Result<Value, ConfigError> {