Skip to content

OPENCODE_SERVER_PASSWORD breaks TUI startup with --mdns or --hostname #29847

@blairhudson

Description

@blairhudson

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions