Repository navigation
Description
Description
On OpenCode Desktop 2.2.6 with the dark color scheme, the pairing QR code (Settings → Pairing, or the "Pair device" command) is rendered light-on-dark, i.e. as an inverted QR code. The OpenCode Android app 0.3.0 does not recognize it, so pairing from the desktop GUI cannot be completed.
The QR is generated in packages/gui-plugins/src/pairing/page.tsx:
renderSVG(value, { border: 4, blackColor: "currentColor", whiteColor: "transparent" })renderSVG paints the dark modules with blackColor and the background/quiet zone with whiteColor (packages/util/src/qr.ts). The surrounding element uses bg-v2-background-bg-base p-6 text-v2-text-text-base, so in the dark theme:
--v2-text-text-base=#fafafa→ light modules--v2-background-bg-base=#161616→ dark background and quiet zone
QR codes are specified as dark modules on a light background. OpenCode's web scanner explicitly works around theme-dependent QRs by calling scanner.setInversionMode("both") in packages/app/src/servers/connect/scanner.tsx, but the Android client does not appear to attempt inverted decoding.
Plugins
superpowers, opencode-github-panel (not related to pairing).
OpenCode version
- Desktop: 2.2.6 (macOS, installed app
ai.opencode.desktop) - Android: 0.3.0
Steps to reproduce
- Open OpenCode Desktop and set the color scheme to Dark.
- Open Settings → Pairing (or run the "Pair device" command) and wait for the QR code to appear.
- In the OpenCode Android app 0.3.0, start the pairing QR scanner and point it at the desktop QR code.
- The Android scanner does not detect the code and pairing never starts.
- Refresh the code or reopen the dialog; the result is the same.
I have not yet repeated step 3 in the light color scheme, but with blackColor: "currentColor" the light theme renders dark modules on a light background, which is the standard orientation.
Expected Behavior
The pairing QR code should be rendered as dark modules on a light background regardless of the desktop color scheme, so any standards-compliant scanner (including the Android app) can read it.
Actual Behavior
In the dark color scheme the QR is inverted (light modules on a dark background), and the Android app does not scan it. Pairing from the desktop GUI fails.
Additional Context
- QR call site: https://github.com/anomalyco/opencode/blob/dev/packages/gui-plugins/src/pairing/page.tsx#L371-L377
renderSVGimplementation: https://github.com/anomalyco/opencode/blob/dev/packages/util/src/qr.ts#L56-L67- Theme tokens: dark text
#fafafa, dark background#161616 - Because
whiteColoristransparent, fixing onlyblackColorwould still leave the quiet zone dark in the dark theme. Both colors need fixed values, or the QR needs a white card background. - The Android scanner could also consider trying inverted barcodes for robustness, since terminal QRs can be inverted depending on the terminal theme. The web scanner already does this.
- Related but different: beta.opencode.ai QR code scanner rejects opencode pair QR code #55027 (old beta web scanner rejects the
{code,urls}payload), android: pairing QR with custom URL retains existing OpenTunnel address #62901, Android 0.3.0: can't connect to LAN servers on Android 17 (missing ACCESS_LOCAL_NETWORK) #62934. - Workaround: switch Desktop to the light color scheme before scanning, or copy the pairing link and paste it into the Android app.
Activity
opencodejr commentedon Nov 10, 2026
Thanks for the detailed report. I can confirm that the pairing QR code is inverted in the dark theme.
I couldn't run the desktop or Android apps here, so I tested the rendering directly. The script below makes the same
renderSVG(..., { blackColor: "currentColor", whiteColor: "transparent" })call as the pairing dialog, fills in the dialog's theme colors and decodes the image with a standard QR decoder (jsQR):#161616modules on white): decodes normally.#fafafamodules on#161616, quiet zone included): fails unless the decoder also tries inverted codes. That matches what you saw with the Android scanner.This still happens on the latest
dev(f454acc): the call inpage.tsxand the dark theme colors are unchanged. As you noted, setting onlyblackColorwouldn't be enough, because the transparent background leaves the quiet zone dark.I haven't checked the Android 0.3.0 scanner itself; that part is based on your report. Until this is fixed, the workarounds you mentioned (light theme, or pasting the pairing link) are the way to pair.
Related pairing issues, though not the same problem: #62901, #59962, #58810.
Reproduction script (repro.ts)
Run it:
bun repro.tsashwinlimaye commentedon Nov 10, 2026
I am unable to get it to scan even as dark-on-light. the android in-app scanner simply does not trigger.