anomalyco / anomalyco/opencode

Bug: Desktop client fails to load environment variables when connected to a WSL remote server (TUI works correctly)

Open
#38,241 0 comments 1 reaction 1 assignee View on GitHub

@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
  1. 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
Image Image
Operating System

Ubuntu2404,Windows11

Terminal

Window Terminal

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.