Setting OPENCODE_SERVER_PASSWORD breaks normal TUI startup when using --mdns or --hostname.
Repro
export OPENCODE_SERVER_PASSWORD=changeme123
opencode --mdns
Also fails with:
export OPENCODE_SERVER_PASSWORD=changeme123
opencode --hostname 0.0.0.0
Error
Error: 4 of 6 requests failed:
config.providers: opencode server GET http://0.0.0.0:4096/config/providers?... → 401 Unauthorized
provider.list: opencode server GET http://0.0.0.0:4096/provider?... → 401 Unauthorized
app.agents: opencode server GET http://0.0.0.0:4096/agent?... → 401 Unauthorized
config.get: opencode server GET http://0.0.0.0:4096/config?... → 401 Unauthorized
Expected
TUI should start successfully.
If OPENCODE_SERVER_PASSWORD enables Basic auth, internal TUI requests should include auth or otherwise work.
Why it matters
--mdns and --hostname 0.0.0.0 expose OpenCode on LAN. Password auth should be usable with those modes.
Setting
OPENCODE_SERVER_PASSWORDbreaks normal TUI startup when using--mdnsor--hostname.Repro
export OPENCODE_SERVER_PASSWORD=changeme123 opencode --mdnsAlso fails with:
export OPENCODE_SERVER_PASSWORD=changeme123 opencode --hostname 0.0.0.0Error
Expected
TUI should start successfully.
If
OPENCODE_SERVER_PASSWORDenables Basic auth, internal TUI requests should include auth or otherwise work.Why it matters
--mdnsand--hostname 0.0.0.0expose OpenCode on LAN. Password auth should be usable with those modes.