Skip to content

Commit 3fd93f6

Browse files
itlackeyclaude
andauthored
docs(assistant): improve socat lmstudio workaround comment (#416)
Verified across OpenCode 1.2.24, 1.3.3 (current pin), and 1.14.50 (latest): - Hardcoded baseURL http://127.0.0.1:1234/v1 still present in models.dev catalog - OpenCode supports `provider` (singular) config key to override but no env var - Writing to opencode.json from entrypoint would violate "never overwrite user files" Comment now records: - Versions verified + date - Pointer to upstream provider.ts mergeProvider for the override path - Why env-var override is the missing piece - Link to related upstream issue anomalyco/opencode#1555 - TODO to file a fresh issue requesting env-var override When OpenCode adds env-var override, this whole function + the socat apt-get dependency in the Dockerfile can be deleted. Co-authored-by: Claude Sonnet 4.6 <[email protected]>
1 parent 9fb9870 commit 3fd93f6

1 file changed

Lines changed: 19 additions & 6 deletions

File tree

‎core/assistant/entrypoint.sh‎

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,28 @@ maybe_enable_ssh() {
8787
}
8888

8989
maybe_proxy_lmstudio() {
90-
# OpenCode's lmstudio provider still ships a hardcoded base URL of
91-
# http://127.0.0.1:1234/v1 (verified through OpenCode 1.3.3, the version
92-
# pinned in this image). The "providers" config key remains unsupported
93-
# there — setting it triggers ConfigInvalidError at startup.
90+
# OpenCode's lmstudio provider catalog entry hardcodes baseURL
91+
# http://127.0.0.1:1234/v1 (verified in v1.2.24, v1.3.3 — currently pinned —
92+
# and v1.14.50 latest as of 2026-05-14). Source: models.dev catalog used by
93+
# @opencode-ai/core/models, mirrored in the OpenCode docs at
94+
# https://opencode.ai/docs/providers#lm-studio.
95+
#
96+
# OpenCode DOES allow overriding via the `provider` (singular) config key
97+
# in opencode.json, e.g.:
98+
# { "provider": { "lmstudio": { "options": { "baseURL": "..." } } } }
99+
# (see packages/opencode/src/provider/provider.ts mergeProvider / cfg.provider
100+
# in the upstream repo at github.com/anomalyco/opencode — formerly sst/opencode).
101+
# However, OpenCode does NOT read an env var for lmstudio baseURL, so the
102+
# OpenPalm `LMSTUDIO_BASE_URL` stack env can't be passed through directly.
103+
#
94104
# Workaround: if LMSTUDIO_BASE_URL points to a remote host, start a TCP
95105
# proxy from 127.0.0.1:1234 to that host so lmstudio requests reach Ollama
96106
# or other local LLM providers running outside the container.
97-
# TODO: drop this proxy (and `socat` from the apt-get install list in the
98-
# Dockerfile) once OpenCode allows runtime baseURL overrides for lmstudio.
107+
#
108+
# TODO(upstream): file an issue requesting an LMSTUDIO_BASE_URL (or generic
109+
# provider.<id>.options.baseURL) env override so we can drop socat entirely.
110+
# Related discussion: https://github.com/anomalyco/opencode/issues/1555
111+
# (LM Studio missing as provider; custom provider for LM Studio non-functional).
99112
local base_url="${LMSTUDIO_BASE_URL:-}"
100113
if [ -z "$base_url" ]; then
101114
return 0

0 commit comments

Comments
 (0)