opencode
opencode copied to clipboard
[FEATURE]: Improve invalid/missing api key response
Feature hasn't been suggested before.
- [x] I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
I have this opencode.jsonc
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"deepseek": {
"options": {
"apiKey": "{env:DEEPSEEK_API_KEY}",
"baseURL": "https://api.deepseek.com/v1
}
}
},
"model": "deepseek/deepseek-reasoner"
}
In my environment I forgot to export the environment variable DEEPSEEP_API_KEY and got the obscure error message:
Unauthorized: Authentication Fails (governor)
It would be nice, now that we can ask for env variables getting a clearer messages stating "envrinment variable DEEPSEEK_API_KEY is not set" or similar.