pairing: pair --remote unreachable (app error -1200); OpenTunnel relay drops all visitor connections
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
The payload names no files; the scoped app-side work is the pairing error path that renders code -1200 / "couldn't reach the opencode server" — find where that message is produced and add a reachability hint or diagnostic detail. The failure itself is in the OpenTunnel visitor relay (256×0xFF then close), outside this repo; compare incidents #54596, #55873 and #54627 before treating it as an app bug. Done means the relay forwards TLS to the attached bridge, or the app tells the user the tunnel is unreachable.
索引モデルが issue の本文から書いたものです。
説明
Summary
Pairing the official Android app through opencode pair --remote fails with "couldn't reach the opencode server" (code -1200). The pairing link and QR code print normally on the desktop, but the OpenTunnel relay (opentunnel.xyz) drops every visitor connection before it can reach the opencode server — this reproduces with the Android app, browsers, and curl, from multiple networks, so the app is surfacing a service-side failure rather than an app bug. The OpenTunnel API/bridge plane is healthy (tunnel creation, certificate issuance, bridge attach, GET /api/tunnel/:id → state: "online"), but the visitor-facing relay answers every TLS ClientHello with 256 bytes of 0xFF and closes, without forwarding the connection over any attached bridge.
Environment
- opencode version: 2.3.2 (background server bundled with the desktop app; npm CLI updated 2.2.7 → 2.3.2 during diagnosis — identical failure on both)
- Android app: version not captured yet (will add; the failure is fully reproducible without the app, see below)
- OS (desktop): Windows 11 Pro 10.0.26200 (win32 x64)
- Install/channel: latest (npm
@opencode/cli+ desktop appai.opencode.desktop) - Active plugins: none configured
Reproduction
All times UTC, 2026-11-22.
- On the desktop:
opencode pair --remote— a fresh tunnel was created at 04:21:45Z (fresh profile, fresh relay id, certificate issued and valid to 2027-02-20; a pre-existing tunnel created 2026-11-09 on a different relay id behaves identically, and both relay ids resolve to the same A/AAAA records). - Scan the QR with the Android app → "couldn't reach the opencode server", code -1200.
- Without the app, from the same machine:
curl https://<route>.<tunnel-id>.opentunnel.xyz/global/health→schannel: next InitializeSecurityContext failed: SEC_E_INVALID_TOKEN;openssl s_client→SSL handshake has read 5 bytes ... packet length too long, no peer certificate. - From a completely external network (separate resolver/egress): the same URL fails with a transport error — not local DNS, firewall, or ISP blocking.
GET https://opentunnel.xyz/api/tunnel/<tunnel-id>(bearer token from the local profile) returns{"state":"online"}at the same moment visitor TLS is failing — the opencode server's bridge is attached and the server advertises the tunnel URL in/api/info.- Decisive test — attached an independent bridge using the same tunnel token at
wss://opentunnel.xyz/api/tunnel/<tunnel-id>/connect(subprotocolopentunnel), claiming a fresh route name covered by the tunnel certificate's wildcard SAN. The server repliedattachedwithroutes: ["<probe-route>"]. A visitor connection made 4 seconds later tohttps://<probe-route>.<tunnel-id>.opentunnel.xyzwas still dropped instantly with the same TLS failure, and the bridge received noopenframe at all. - Raw TCP probe against the relay with a hand-crafted TLS 1.2 ClientHello (validated against a control host): the relay responds with exactly 256 bytes of
0xFFand closes cleanly. Plain HTTP on port 443 gets no response. Identical for every SNI tried (route subdomains, the bare tunnel hostname, a nonexistent route label).
Expected Behavior
Per the OpenTunnel protocol, the public listener reads the ClientHello, resolves the SNI route, and forwards the connection over the bridge WebSocket that claimed that route; the client terminates TLS locally with the tunnel certificate. The Android app should complete pairing and connect to the opencode server.
Actual Behavior
Every public TCP connection to the relay (A 168.220.93.252, AAAA 2a09:8280:1::1af:1918:0 — the same records served for both the 2026-11-09 and the fresh 2026-11-22 tunnel ids) is answered with 256 × 0xFF and closed within ~100 ms, regardless of which routes are claimed by attached bridges. The Android app reports the resulting TLS failure as "couldn't reach the opencode server" with code -1200; curl/browsers see a broken handshake; the connection never reaches the opencode server.
Additional Context
- DNS resolves correctly; TCP connectivity to the relay port 443 succeeds. The Cloudflare-fronted API works throughout the same window (tunnel creation and certificate issuance succeeded), so the origin's HTTPS path is healthy while the raw-TCP visitor path is not.
- A local "stuck tunnel" was ruled out: the documented recovery (clearing
~/.local/share/opentunnel/<profile>/) was applied, producing a completely fresh tunnel, relay id, and certificate — the failure is identical before and after. - The background service (2.3.2) is otherwise healthy: one server process, bridge attached,
/api/infoadvertiseshttps://<route>.<tunnel-id>.opentunnel.xyz. From the opencode side everything looks like it should work; only the OpenTunnel visitor plane disagrees. - Route labels and one-time pairing codes are redacted (they are the URL's only secret); the fresh tunnel was created 2026-11-22T04:21:45Z with a certificate valid to 2027-02-20, so it can be identified server-side by creation time. The exact route label can be shared privately if needed for debugging.
- Suggestion for the app side, regardless of the service fix: the -1200 / "couldn't reach the opencode server" message gives no hint that the failure may be upstream of the app. A quick reachability hint (e.g. "the server's tunnel appears unreachable — try again later or check opencode.ai/status") or a diagnostic view showing where the connection died would make outages like this much easier to self-diagnose.
- Originally filed at anomalyco/opencode#65521; moved here as the mobile-app-facing report. Related prior opentunnel.xyz service incidents: anomalyco/opencode#54596 (2026-10-11), #55873 (2026-10-15), #54627 (2026-10-11..13, same symptom on iOS).
- 主要言語
- Kotlin
- スター
- 146
- フォーク
- 35
- 平均マージ
- 7時間 41分
- マージ済み PR(30日)
- 221
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
anomalyco/opencode-android のほかの issue
-
F-droid releaseオープン
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
anomalyco/opencode-android#345 ·
メンテナーはふだん 1 日以内に返信
-
Crash: IllegalStateException in AppContext.getLiveValue対応中かも @Tarquinen が 1 日前に担当しました。 オープンcrash crash-triaged
難易度 3/5 半日 初心者へのやさしさ 65/100
anomalyco/opencode-android#343 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
crash crash-needs-human crash-triaged
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
anomalyco/opencode-android#341 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
crash crash-needs-human crash-triaged
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
anomalyco/opencode-android#340 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Crash: OutOfMemoryError in LiveTransportKt$awaitResponse$2$2.onResponse対応中かも @Tarquinen が 3 日前に担当しました。 オープンcrash crash-triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
anomalyco/opencode-android#320 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
anomalyco/opencode-android の issue をすべて見る
似ている issue
-
[Request]: Kylleneオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
ScoopInstaller/Extras#19589 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
difficulty: beginner documentation help wanted networking
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
feature request needs decision
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
tswistak/Battery-Monitor#207 ·
メンテナーはふだん 1 日以内に返信