feat(server): add OPENCODE_HOST env var for external OpenCode connections (#499)

* feat(server): add OPENCODE_HOST env var for external OpenCode connections

Allows specifying a full base URL (e.g. https://hostname:4096) for external
OpenCode connections, supporting custom hostnames and HTTPS. When set,
OPENCODE_HOST overrides OPENCODE_PORT. Malformed values are fatal at startup.

* docs: document OPENCODE_HOST env var in README and AGENTS

* Fatal error when OPENCODE_HOST has path, search or hash

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Colin Mollenhour <colin@mollenhour.com>

* fix(server): use external origin when re-probing OpenCode

---------

Signed-off-by: Colin Mollenhour <colin@mollenhour.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Colin Mollenhour
2026-02-25 19:42:32 +02:00
committed by GitHub
co-authored by Copilot
parent 7a151290be
commit e02002bc9f
5 changed files with 63 additions and 18 deletions
+1
View File
@@ -177,6 +177,7 @@ OPTIONS:
ENVIRONMENT:
OPENCHAMBER_UI_PASSWORD Alternative to --ui-password flag
OPENCODE_HOST External OpenCode server base URL, e.g. http://hostname:4096 (overrides OPENCODE_PORT)
OPENCODE_PORT Port of external OpenCode server to connect to
OPENCODE_SKIP_START Skip starting OpenCode, use external server