You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The opencode serve command appears to ignore the configuration file (tested via passing the OPENCODE_CONFIG environment variable, which resolves to the highest precedence in my configuration).
The server binds to the loopback interface (127.0.0.1:4096) despite the hostname and port being set to 0.0.0.0:9090 in the provided configuration file.
Expected:
The configuration file provided via OPENCODE_CONFIG should be honored as specified in the server block.
Plugins
N/A
OpenCode version
1.2.27
Steps to reproduce
Opencode with version 1.2.27 installed
Configuration file set using env var OPENCODE_CONFIG as highest precedence
@1000p I was able to Reproduce, seems like config for serve command is stuck only using the Global Config, im working on a PR that adds that fact to the docs but also supports use of custom configs set by the OPENCODE_CONFIG variable
@1000p I use opencode for both personal use and at work and I rely on OPENCODE_CONFIG to alter my configuration between directories. I organically encountered this issue and investigated the code and GitHub issues to find myself here. I see there is another PR aiming to resolve this by @OpeOginni, but I decided to take another stab at it since that one has been waiting for a bit. I aimed to make my attempt at resolving this issue focused, reuse as much of the existing code as possible, and I have been able to verify the functionality on my system. I'm pretty new to open source but I've been in the industry for over a decade. If there is anything you need from me to as far as implementation adjustment or ceremonially in how to go about introducing a change like this, please feel free to nudge me in the right direction.
@thdxr@rekram1-node do you have any feedback for this change? I'm on a weekly cadence of rebasing and keeping it up to date currently. I notice the recent activity of removing tags and am just wondering if there is some kind of path forward here. I actively use my fork locally as I have not found any other way for my server config settings to be honored.
Related: #34638 — opencode acp has the same root cause. Both serve and acp are non-TUI subcommands that skip the config initialization pipeline used by CLI/TUI mode. In acp mode, OPENCODE_CONFIG_CONTENT, OPENCODE_CONFIG_DIR, cwd opencode.json, and OPENAI_API_KEY/OPENAI_BASE_URL are all ignored — the ACP subprocess uses only ~/.config/opencode/opencode.json.
This blocks tooling that launches opencode acp as a subprocess (editors, CI, multi-agent orchestrators like Charon) from injecting per-run provider overrides. The fix for serve (PR #23318?) would likely fix acp as well if it addresses the shared initialization gap.
Activity
OpeOginni commentedon Mar 25, 2026
@1000p I was able to Reproduce, seems like config for serve command is stuck only using the Global Config, im working on a PR that adds that fact to the docs but also supports use of custom configs set by the
OPENCODE_CONFIGvariablefix(core): respect OPENCODE_CONFIG and OPENCODE_CONFIG_CONTENT in ser…
brian-dlee commentedon Apr 18, 2026
@1000p I use opencode for both personal use and at work and I rely on
OPENCODE_CONFIGto alter my configuration between directories. I organically encountered this issue and investigated the code and GitHub issues to find myself here. I see there is another PR aiming to resolve this by @OpeOginni, but I decided to take another stab at it since that one has been waiting for a bit. I aimed to make my attempt at resolving this issue focused, reuse as much of the existing code as possible, and I have been able to verify the functionality on my system. I'm pretty new to open source but I've been in the industry for over a decade. If there is anything you need from me to as far as implementation adjustment or ceremonially in how to go about introducing a change like this, please feel free to nudge me in the right direction.brian-dlee commentedon May 11, 2026
@thdxr @rekram1-node do you have any feedback for this change? I'm on a weekly cadence of rebasing and keeping it up to date currently. I notice the recent activity of removing tags and am just wondering if there is some kind of path forward here. I actively use my fork locally as I have not found any other way for my server config settings to be honored.
Nnyan commentedon Jun 30, 2026
Related: #34638 —
opencode acphas the same root cause. Bothserveandacpare non-TUI subcommands that skip the config initialization pipeline used by CLI/TUI mode. Inacpmode,OPENCODE_CONFIG_CONTENT,OPENCODE_CONFIG_DIR, cwdopencode.json, andOPENAI_API_KEY/OPENAI_BASE_URLare all ignored — the ACP subprocess uses only~/.config/opencode/opencode.json.This blocks tooling that launches
opencode acpas a subprocess (editors, CI, multi-agent orchestrators like Charon) from injecting per-run provider overrides. The fix forserve(PR #23318?) would likely fixacpas well if it addresses the shared initialization gap.fix(core): respect OPENCODE_CONFIG and OPENCODE_CONFIG_CONTENT in ser…
github-actions commentedon Aug 30, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.