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
Terminal WebSocket URL contains a double slash when the server URL ends with / #45891
When a configured server URL ends with /, opening a terminal constructs its WebSocket URL with a double slash before the PTY route. Servers and reverse proxies that do not normalize repeated slashes can reject the connection with a 404, leaving the terminal unable to connect.
The terminal URL helper appends the PTY route directly to the server URL. For example, combining https://example.test/ with /api/pty/pty_test/connect produces a pathname beginning with //api. Parsing the base URL first and joining the pathname at a single slash boundary would preserve the server path while avoiding the duplicate separator.
Plugins
N/A
OpenCode version
N/A (reproduced in the URL helper)
Steps to reproduce
Configure the server URL as https://example.test/, including the trailing slash.
Create a terminal connection with PTY ID pty_test.
Inspect the WebSocket URL produced for the terminal connection.
Observed URL:
wss://example.test//api/pty/pty_test/connect
Expected URL:
wss://example.test/api/pty/pty_test/connect
The same result can be reproduced directly by evaluating new URL("https://example.test//api/pty/pty_test/connect").pathname, which returns //api/pty/pty_test/connect.
Screenshot and/or share link
Not provided; the generated URL above is the deterministic reproduction.
This is fixed in v2: terminal WebSocket URLs are joined relative to the server URL, preserving its base path without adding a second slash before api/pty. To install v2, run npm i -g @opencode/cli@latest (or update the desktop app). If you still see this on v2, please open a new issue with the details.
Activity
sdivyanshu90 commentedon Sep 19, 2026
Could you please review this issue?
neriousy commentedon Oct 19, 2026
This is fixed in v2: terminal WebSocket URLs are joined relative to the server URL, preserving its base path without adding a second slash before
api/pty. To install v2, runnpm i -g @opencode/cli@latest(or update the desktop app). If you still see this on v2, please open a new issue with the details.