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
{{ message }}
Repository navigation
cli: models and session listing hang instead of erroring when the cwd does not exist on the server #62682
When --server points at a remote server and the client's cwd does not exist on that server, opencode models and session listing hang with no output instead of returning an error. Aligning the client cwd with an existing path on the server makes both commands respond immediately.
Environment
opencode version: 2.2.6 (client and server)
OS (server): Darwin 27.0.0 arm64 (macOS)
OS (client): Ubuntu 24.04.5 LTS (x86_64), cloud VM
Terminal: non-interactive / no TTY (scripted invocation)
Start opencode serve --hostname 0.0.0.0 --port 4096 on the server.
On the client, run opencode --server http://<server>:4096 models from a directory path that does not exist on the server.
Observe: no output, no error, indefinite hang.
Run the same command from a path that exists on the server (for example /Users/<user>/project); it returns immediately.
Expected Behavior
A clear error such as "location/directory does not exist on the server", or a fallback to a valid directory.
Actual Behavior
Indefinite hang with no output and no error.
Additional Context
The client's cwd is sent as the session location.directory; the server cannot resolve it and the request never completes.
Workaround: cd to a path that exists on the server, or pass an explicit directory where supported.
Suggestion: validate the location on the server and fail fast.
Thanks for the detailed report! I tried this on 2.2.6 with a Linux server and a client cwd the server can't see. Both commands failed straight away with a clear error instead of hanging:
opencode --server … models printed LocationNotFoundError: Location not found: <dir>
opencode session list --server … printed Location not found: <dir>
That's the expected behaviour: the server checks the directory and should answer with LocationNotFoundError. So the hang probably depends on something in your setup, most likely the macOS server, which I can't test here. One possible cause: on macOS, /home is managed by the automounter, so if your client cwd is something like /home/ubuntu/..., checking that path on the server might stall. That's a guess, not something I've confirmed.
A maintainer with a macOS server will need to look at this. A few details would help:
The exact client cwd that hangs, e.g. /home/ubuntu/... or something else.
Whether it still hangs from a missing path outside /home, e.g. mkdir -p /tmp/nope/x && cd /tmp/nope/x && opencode --server http://<server>:4096 models.
I tested the official @opencode/[email protected] binary on macOS 27.3 arm64 with isolated configuration and storage. On direct loopback, /api/location and /api/model returned HTTP 404 LocationNotFoundError for both missing paths:
/private/tmp/oss-cwd-does-not-exist-62682: 12–16 ms
/home/ubuntu/opencode-62682-missing: 207–236 ms
I also ran the real models and session list commands through a loopback pass-through proxy that substituted those paths in location[directory]. Both exited with status 1 and the location error in 62–243 ms; the existing-directory controls exited 0. No model requests were made.
This does not reproduce the remote tunnel or Darwin 27.0 environment in the report. A local request on the affected server, using the exact client cwd, would help distinguish filesystem validation from the network path:
Activity
opencodejr commentedon Nov 8, 2026
Thanks for the detailed report! I tried this on 2.2.6 with a Linux server and a client cwd the server can't see. Both commands failed straight away with a clear error instead of hanging:
opencode --server … modelsprintedLocationNotFoundError: Location not found: <dir>opencode session list --server …printedLocation not found: <dir>That's the expected behaviour: the server checks the directory and should answer with
LocationNotFoundError. So the hang probably depends on something in your setup, most likely the macOS server, which I can't test here. One possible cause: on macOS,/homeis managed by the automounter, so if your client cwd is something like/home/ubuntu/..., checking that path on the server might stall. That's a guess, not something I've confirmed.A maintainer with a macOS server will need to look at this. A few details would help:
/home/ubuntu/...or something else./home, e.g.mkdir -p /tmp/nope/x && cd /tmp/nope/x && opencode --server http://<server>:4096 models.curlto the server works quickly from that client, to rule out the network path you described in cli: run hangs before creating a session when the initial SSE event is buffered #62681.Related: #62681 (same setup,
runhangs on a buffered event stream) and #62469 (clearer errors for invalid session locations).r266-tech commentedon Nov 8, 2026
I tested the official
@opencode/[email protected]binary on macOS 27.3 arm64 with isolated configuration and storage. On direct loopback,/api/locationand/api/modelreturned HTTP 404LocationNotFoundErrorfor both missing paths:/private/tmp/oss-cwd-does-not-exist-62682: 12–16 ms/home/ubuntu/opencode-62682-missing: 207–236 msI also ran the real
modelsandsession listcommands through a loopback pass-through proxy that substituted those paths inlocation[directory]. Both exited with status 1 and the location error in 62–243 ms; the existing-directory controls exited 0. No model requests were made.This does not reproduce the remote tunnel or Darwin 27.0 environment in the report. A local request on the affected server, using the exact client cwd, would help distinguish filesystem validation from the network path:
AI-assisted investigation.