anomalyco / anomalyco/opencode
Bug: Desktop client fails to load environment variables when connected to a WSL remote server (TUI works correctly)
@Hona is already working on this.
Since Jul 22, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
When using opencode with a WSL server, the TUI client loads and uses environment
variables correctly, but the Desktop client does not recognize them. Any operation
that depends on those variables fails with an error.
Plugins
No response
OpenCode version
1.18.4
Steps to reproduce
- Define environment variables inside WSL (e.g. in
~/.bashrc):export COMPANY_KEY="sk-xxxx" export COMPANY_BASEURL="https://api.example.com"
2.Reference those variables in opencode.jsonc:
{
"provider": {
"my-provider": {
"options": {
"apiKey": "{env:COMPANY_KEY}",
"baseURL": "{env:COMPANY_BASEURL}"
}
}
}
}
3.Launch the Desktop client and connect to the WSL server.
4.Select a model and start a conversation.Observe the result.
Screenshot and/or share link
Operating System
Ubuntu2404,Windows11
Terminal
Window Terminal
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.