From 2ba14d3e6d3738a1ad690b915fd538c8b8f34a14 Mon Sep 17 00:00:00 2001 From: Anton Volnuhin Date: Thu, 6 Aug 2026 02:53:27 +0300 Subject: [PATCH] opencode: fix invalid config and externalize the bailian key opencode rejected the config with "Unrecognized key: providers". The file had both `provider` (opencode's schema: npm + options) and `providers` (package: "aisdk:..." + settings, some other tool's shape, left behind by an api-for-cursor script back in July). The Alibaba/Qwen provider lived only under the rejected key, so it had never actually reached opencode. Translate it into the real schema -- package -> npm, settings -> options at both provider and model level -- rather than dropping it, so those five qwen models now work. The duplicate cursorapi under `providers` is dropped: the existing provider.cursorapi is a superset, with four models plus cost and limit metadata. The 113-char bailian key moves to secrets/bailian-api-key (0600) and is referenced as {file:./secrets/bailian-api-key}, which opencode resolves relative to the config dir -- so no absolute home path, and no shell export needed on ssh-only boxes. Verified by pointing it at a missing file and getting "bad file reference". With the key out, opencode.json can finally be tracked. Ignore the secrets dir, the stale .bak copies that still contain it, and the node/bun lockfiles. --- .chezmoiignore | 7 + private_dot_config/opencode/opencode.json | 170 ++++++++++++++++++++++ 2 files changed, 177 insertions(+) create mode 100644 private_dot_config/opencode/opencode.json diff --git a/.chezmoiignore b/.chezmoiignore index b44b225..7b610e8 100644 --- a/.chezmoiignore +++ b/.chezmoiignore @@ -40,6 +40,13 @@ Library .reasonix/.env .reasonix/sessions .reasonix/projects +.config/opencode/secrets +.config/opencode/*.bak +.config/opencode/*.bak.* +.config/opencode/*backup* +.config/opencode/node_modules +.config/opencode/bun.lock +.config/opencode/package-lock.json # kitty: the light/dark mode is per-machine, and the *-theme.auto.conf files # are generated from it plus .config/kitty/themes. Tracking them would make diff --git a/private_dot_config/opencode/opencode.json b/private_dot_config/opencode/opencode.json new file mode 100644 index 0000000..e51445c --- /dev/null +++ b/private_dot_config/opencode/opencode.json @@ -0,0 +1,170 @@ +{ + "$schema": "https://opencode.ai/config.json", + "model": "cursorapi/composer-2.5-fast", + "provider": { + "cursorapi": { + "models": { + "composer-2.5": { + "cost": { + "input": 0.5, + "output": 2.5 + }, + "limit": { + "context": 200000, + "output": 65536 + }, + "name": "Composer 2.5" + }, + "composer-2.5-fast": { + "cost": { + "input": 3, + "output": 15 + }, + "limit": { + "context": 200000, + "output": 65536 + }, + "name": "Composer 2.5 Fast" + }, + "grok-4.5": { + "cost": { + "input": 2, + "output": 6 + }, + "limit": { + "context": 200000, + "output": 65536 + }, + "name": "Grok 4.5" + }, + "grok-4.5-fast": { + "cost": { + "input": 4, + "output": 18 + }, + "limit": { + "context": 200000, + "output": 65536 + }, + "name": "Grok 4.5 Fast" + } + }, + "name": "API for Cursor", + "npm": "@ai-sdk/openai-compatible", + "options": { + "apiKey": "cursor-local", + "baseURL": "http://127.0.0.1:8788/v1" + } + }, + "bailian-token-plan-personal": { + "models": { + "qwen3.6-flash": { + "capabilities": { + "input": [ + "text", + "image" + ], + "output": [ + "text" + ], + "tools": true + }, + "name": "Qwen3.6 Flash", + "options": { + "thinking": { + "budgetTokens": 8192, + "type": "enabled" + } + } + }, + "qwen3.6-plus": { + "capabilities": { + "input": [ + "text", + "image" + ], + "output": [ + "text" + ], + "tools": true + }, + "name": "Qwen3.6 Plus", + "options": { + "thinking": { + "budgetTokens": 8192, + "type": "enabled" + } + } + }, + "qwen3.7-max": { + "capabilities": { + "input": [ + "text" + ], + "output": [ + "text" + ], + "tools": true + }, + "name": "Qwen3.7 Max", + "options": { + "thinking": { + "budgetTokens": 8192, + "type": "enabled" + } + } + }, + "qwen3.7-plus": { + "capabilities": { + "input": [ + "text", + "image" + ], + "output": [ + "text" + ], + "tools": true + }, + "name": "Qwen3.7 Plus", + "options": { + "thinking": { + "budgetTokens": 8192, + "type": "enabled" + } + } + }, + "qwen3.8-max-preview": { + "body": { + "temperature": 0.6 + }, + "capabilities": { + "input": [ + "text" + ], + "output": [ + "text" + ], + "tools": true + }, + "limit": { + "context": 983616, + "output": 131072 + }, + "name": "Qwen3.8 Max Preview", + "options": { + "thinking": { + "budgetTokens": 99072, + "type": "enabled" + } + } + } + }, + "name": "Alibaba Cloud Model Studio", + "npm": "@ai-sdk/anthropic", + "options": { + "apiKey": "{file:./secrets/bailian-api-key}", + "baseURL": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic/v1" + } + } + } +}