[PR #5898] server: ensure frontend has correct port for PTY websocket connections #11634

Closed
opened 2026-02-16 18:16:31 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/5898

State: closed
Merged: Yes


This PR fixes the PTY WebSocket URL construction by injecting the server port into the frontend HTML via a script tag. This ensures that the frontend can correctly resolve the PTY connection even when running on a different port than the default.

  • packages/desktop/src/app.tsx: fallback to window.location.origin for sdk url
  • packages/opencode/src/server/server.ts: inject server port into frontend HTML via script tag

Resolves #5844

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/5898 **State:** closed **Merged:** Yes --- This PR fixes the PTY WebSocket URL construction by injecting the server port into the frontend HTML via a script tag. This ensures that the frontend can correctly resolve the PTY connection even when running on a different port than the default. - `packages/desktop/src/app.tsx`: fallback to `window.location.origin` for sdk url - `packages/opencode/src/server/server.ts`: inject server port into frontend HTML via script tag Resolves #5844
yindo added the pull-request label 2026-02-16 18:16:31 -05:00
yindo closed this issue 2026-02-16 18:16:31 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11634