Skip to content

CLI: says failed to start opencode serve at first, but later generate a QR that doesnt work #128

Description

@spicybirsge

When launching using npx crosscode the cli at first prints:

Image

however after a while it generates a QR code.

But still when the QR code is scanned by the mobile app it doesnt connect saying remove server is unreachable.

Also additional note, I am on starter tier using connect.crosscode.site.

Mobile app says this:

Image

Also I am using opencode v2

Activity

  1. snhsish commented on Oct 1, 2026

    @snhsish
    Owner

    Thanks for the detailed report! The root causes are fixed in PR #130 (branch fix/cli-tier-v2-unreachable):

    1. 'Failed to start opencode serve' — the CLI passed --log-level DEBUG (uppercase), which opencode v2 rejects, killing the server at startup. The CLI now detects your server major via opencode --version and uses the matching flags (debug on v2), health endpoint (/api/info), and /api/* proxy routes.
    2. QR generated anyway but dead — a spawn failure only printed the error while startup continued to a scannable-but-dead QR. Spawn failures now abort immediately, and port detection only returns health-verified ports, so you'll get a clear error instead of a dead QR.
    3. App says 'remote server unreachable' — the app probed only /global/health, which on v2 serves the web UI instead of JSON. It now probes /api/info first and caches the detected version per connection.

    To try it: pull the branch (or wait for merge + release), run npx crosscode again, and rescan. If your v2 binary lives under a different command, set "opencodeBin": "opencode-v2" in ~/.crosscode/config.json or CROSSCODE_OPENCODE_BIN. If it still fails, please share the output with CROSSCODE_DEBUG=1 and the last lines of ~/.crosscode/crosscode.log.

  2. spicybirsge commented on Oct 1, 2026

    @spicybirsge
    Author

    Hi there,
    the Failed to start opencode serve issue with a dead QR is still present. Do I need to manually configure anything?

  3. reopened this on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions