cli: pair QR code encodes localhost link when server listens on 0.0.0.0
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- cli, networking
Direzione di ricerca
Parti dal comando opencode pair e segui come seleziona l’URL per il codice QR quando stampa sia i link loopback sia quelli LAN. L’issue fornisce una configurazione riproducibile e una soluzione alternativa con --url; confronta questi output per trovare il punto in cui avviene la selezione. Il lavoro è concluso quando il QR predefinito codifica un link raggiungibile da un altro dispositivo sulla LAN.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
opencode service set hostname 0.0.0.0thenopencode service start.- Run
opencode pair. - Observe the output: two links are printed — one to
http://127.0.0.1:<port>/auth/connect/...and one tohttp://<lan-ip>:<port>/auth/connect/.... - 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.
- Lingua principale
- TypeScript
- Stelle
- 213k
- Fork
- 28.4k
- Merge medio
- 7h 22m
- PR unite (30g)
- 276
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di anomalyco/opencode
-
pending close triaging
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
anomalyco/opencode#55070 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
opencode on clean macos zsh .export path not working because it append and it fails because no ~/.zshrc fileForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertareproduced
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
anomalyco/opencode#55068 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
anomalyco/opencode#54919 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
triaging
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
anomalyco/opencode#54887 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
web: sanitizer strips MathML <annotation>/<semantics> from rendered KaTeX — LaTeX source missing from DOM (copy-to-LaTeX tools broken)Forse già presa @Dante-dan l’ha presa 1 giorno fa. Apertareproduced
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
anomalyco/opencode#54769 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di anomalyco/opencode
Issue simili
-
Contrib indemnité de départ à la retraite : faire le pont avec le simulateur sur la page génériqueApertaP1
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
SocialGouv/code-du-travail-numerique#7561 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
kubernetes-sigs/headlamp#7950 ·
I maintainer di solito rispondono entro 3 giorni
-
README for cliForse già presa @Janvi-kapoor l’ha presa oggi. ApertaOSCI'26
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
GauravKarakoti/SecureFlow#1308 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
vitest-dev/vitest#11577 ·
I maintainer di solito rispondono entro 1 giorno