Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

cli: pair QR encodes custom JSON payload instead of plain connect URL

オープン 初心者向け
#54,871 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
cli, networking

調査の方向性

opencode pair コマンドから始め、loopback と LAN の両方のリンクを出力するときに、QR コード用の URL がどのように選択されるかを追ってください。issue には再現可能な設定と --url を使った回避策が示されています。それらの出力を比較して、選択箇所を見つけてください。デフォルトの QR コードが、LAN 上の別のデバイスからアクセスできるリンクをエンコードすれば完了です。

索引モデルが issue の本文から書いたものです。

説明

reproduced

Summary

When the background service listens on all interfaces (hostname 0.0.0.0), opencode pair prints two one-time links (loopback and LAN IP) but the QR code encodes the 127.0.0.1 link, which can never be reached from another device — so scanning it with a phone on the same network always fails.

Environment

  • opencode version: v2.0.27 (latest channel)
  • OS: Darwin 25.6.0 (darwin arm64), macOS MacBook Pro
  • Terminal: Ghostty (TERM_PROGRAM=ghostty, TERM=xterm-ghostty, COLORTERM=truecolor)
  • Shell: /bin/zsh
  • Install/channel: latest release
  • Active plugins: none found in config

Reproduction

  1. opencode service set hostname 0.0.0.0 then opencode service start.
  2. Run opencode pair.
  3. Observe the output: two links are printed — one to http://127.0.0.1:<port>/auth/connect/... and one to http://<lan-ip>:<port>/auth/connect/....
  4. Scan the QR code with a phone on the same LAN (or decode it).

Expected Behavior

The QR code should encode the link reachable from other devices — i.e., the LAN IP link when bound to 0.0.0.0. At minimum, it should not encode the loopback address, which is unreachable by definition from any remote device.

Actual Behavior

The QR encodes http://127.0.0.1:<port>/auth/connect/.... Scanning it with a phone opens a page on the phone itself and fails; the user must manually retype the second printed URL to pair.

Sample output (token redacted):

Open a link to connect. Links work once and expire in 5 minutes.

  http://127.0.0.1:49374/auth/connect/MG_...
  http://192.168.x.x:49374/auth/connect/MG_...

Additional Context

  • Consistently reproducible whenever the service is bound to a non-loopback hostname.
  • Workaround that confirms intent: opencode pair --url http://<lan-ip>:<port> prints only the LAN link, and the QR then encodes it correctly — so the fix likely just needs the default QR payload to prefer the non-loopback link when multiple are printed.
主要言語
TypeScript
スター
213k
フォーク
28.4k
平均マージ
8時間 32分
マージ済み PR(30日)
253

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

anomalyco/opencode のほかの issue

anomalyco/opencode の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。