opencode
opencode copied to clipboard
fix(providers.opencode): check config for api key in addition to auth
Without this, you can't use ~/.config/opencode/opencode.json to set the opencode API key without also having .opencode.key in ~/.local/share/opencode/auth.json set to any string. Notably, this means you can't store your opencode zen api key in an environment variable without also exposing it (or some other string) in auth.json.
Note: although I tested this change and I understand what it does (it's two lines), this code was written by an AI and I don't know typescript that well, so feel free to say if there's something I should do differently.