remote: pair --remote tunnel fails to serve /api/session on Windows
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 42/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- cli, desktop-dev, networking
調査の方向性
Start with opencode pair --remote --yes, compare local and tunnel responses for /api/info and /api/session, and inspect the built-in OpenTunnel client/relay path plus Windows CLI packaging. Use the tunnel request logs and ~/.local/share/opencode/log/opencode.log to identify where TLS handshaking or response streaming stalls. Done means both authenticated endpoints remain reliably reachable through the Windows tunnel, including the larger session response.
索引モデルが issue の本文から書いたものです。
説明
Description
Summary
opencode pair --remote produces an OpenTunnel URL that is not usable from Windows: the tunnel host accepts TCP but TLS/HTTP requests intermittently fail with handshake errors or hang. /api/info sometimes returns 200, while /api/session consistently times out, so the mobile app cannot load sessions. The local service is healthy, so this looks like a problem with the built-in OpenTunnel relay/client, not with session storage.
Environment
- opencode version: 2.1.4 (CLI bundled with OpenCode Desktop). A separate 2.4.2 CLI is installed, but the Desktop app automatically keeps the background service on 2.1.4.
- OS: Windows 10 Pro, 10.0.19045.6456 (win32 x64).
- Terminal:
TERM=xterm-256color;TERM_PROGRAM,COLORTERM,WT_SESSION,ConEmuPIDnot set. - Shell:
ComSpec=C:\Windows\system32\cmd.exe(commands executed from PowerShell 5.1). - Install/channel: desktop bundle, channel
latest. - Active plugins: none found in
~/.config/opencode/opencode.json,~/.config/opencode/opencode.jsonc, workspaceopencode.json/opencode.jsonc, or.opencode/plugin(s)directories.
Reproduction
- Start/confirm the background service:
opencode service status→http://127.0.0.1:28894. - Run
opencode pair --remote --yes. - The command prints a one-time URL like
https://<random>.e2j5z6dq6j6t.opentunnel.xyz/auth/connect/<token>. - From the same PC, request API endpoints through the tunnel with the service Basic auth:
curl -u "opencode:<password>" https://<tunnel-host>/api/infocurl -u "opencode:<password>" https://<tunnel-host>/api/session
- Compare with the same endpoints on
http://127.0.0.1:28894.
Expected Behavior
The remote URL should proxy all authenticated API endpoints reliably, including /api/session, so a browser or mobile app can load the session list.
Actual Behavior
Local endpoints are fast and correct:
/api/info -> HTTP 200
/api/session -> HTTP 200, 34839 bytes, ~0.10 s
Through the tunnel, across three generated links and two tunnel hostnames:
/api/info -> HTTP 200 1.66 s, then later:
curl: (35) schannel: failed to receive handshake, SSL/TLS connection failed
/api/session -> curl: (28) Connection timed out after 25006 milliseconds 000 25.006943
/api/session?limit=1, /api/session?limit=5, /api/project -> TLS handshake failures
An independent external fetch of the same https://<tunnel-host>/api/info also timed out, so the failure is not specific to this PC/network. DNS resolves the tunnel host to 168.220.93.252; a raw TCP connect to port 443 succeeds, but the TLS handshake fails. Sometimes Get-NetTCPConnection showed established connections to the relay, but requests still hung.
The mobile app reports "не удалось загрузить сессии" ("failed to load sessions") after a successful pairing, which matches /api/session failing through the tunnel.
Additional Context
- Frequency: consistently reproducible over several hours;
/api/infois intermittently reachable,/api/sessionis not. - Full toggle did not help:
service set remote false→service restart→service set remote true→service restart→pair --remote --yesproduced a new hostname with the same behavior. opencode service get remotereturnstrue;opencode service get corsreturns[]; local/api/infolists bothhttp://127.0.0.1:28894and the tunnel URL.- No tunnel-specific errors were found in
~/.local/share/opencode/log/opencode.logat the default log level.pair --remote --yes --print-logs --log-level debugproduced no extra diagnostics; the CLI help notes server logs require--standalone. - Attempting to use a standalone OpenTunnel CLI on Windows is not currently possible:
npm install -g opentunnelinstalls only the wrapper,opentunnel route add 28894says the right platform CLI is missing, and@opentunnel/cli-win32-x64returns 404. - Switching the background service to the separately installed 2.4.2 CLI does not stick because OpenCode Desktop restarts the 2.1.4 service.
- Workaround that works: reverse SSH tunnel from the PC to a trusted VPS, plus a Caddy HTTPS reverse proxy on a public hostname. Both
/api/infoand/api/sessionthen return 200 in about 0.5 s, and the mobile app connects. - Please check the Windows built-in OpenTunnel client/relay path, especially TLS handshake and larger/longer API responses such as
/api/session.
Plugins
No response
OpenCode version
No response
Steps to reproduce
No response
Screenshot
No response
Operating System
No response
Terminal
No response
- 主要言語
- TypeScript
- スター
- 230k
- フォーク
- 31.3k
- 平均マージ
- 5時間 32分
- マージ済み PR(30日)
- 453
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
anomalyco/opencode のほかの issue
-
area/desktop platform/macos status/repro-plausible type/bug version/v2
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
anomalyco/opencode#67064 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 半日 初心者へのやさしさ 82/100
anomalyco/opencode#67009 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
area/web type/feature version/v2
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
anomalyco/opencode#67001 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
skills: a Claude-compatible SKILL.md that fails to parse is dropped without any log対応中かも @liwenjie200543 が 2 日前に担当しました。 オープンarea/plugins platform/linux reproduced type/bug version/v2
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
anomalyco/opencode#66970 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
tui: Mermaid renderer displays <b>/<strong> tags literally and ignores \n line breaks対応中かも @argszero が 2 日前に担当しました。 オープンarea/tui platform/wsl status/repro-simulated type/bug version/v2
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
anomalyco/opencode#66773 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
anomalyco/opencode の issue をすべて見る
似ている issue
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
EPPIcenter/sampledb3#162 ·
-
Particle-1 modelオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
tashfeenahmed/freellmapi#2169 ·
メンテナーはふだん 1 日以内に返信
-
via-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
🎙️ task - feat(mechanic): pave git.pull.close, a close of a superseded pull with its why on recordオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ehmpathy/rhachet-roles-ehmpathy#1576 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
vercel-labs/ui#1563 ·
メンテナーはふだん 1 日以内に返信