Skip to content

Uppercase OpenCode deep-link schemes are rejected #47581

Closed as not planned
Closed as not planned

Description

@sdivyanshu90

Description

OpenCode rejects otherwise valid deep links when the opencode URI scheme contains uppercase or mixed-case letters. Both open-project and new-session links are affected. URI schemes are case-insensitive under RFC 3986, and the URL parser accepts and normalizes these inputs, but the app performs a case-sensitive startsWith("opencode://") check before parsing.

This means a launcher or integration that emits OPENCODE:// cannot open a project or start a session even though it identifies the same scheme as opencode://. The parser should validate the parsed URL protocol case-insensitively instead of checking the raw prefix.

Reference: https://www.rfc-editor.org/rfc/rfc3986.html#section-3.1

Plugins

N/A

OpenCode version

N/A (reproduced in the shared deep-link parser)

Steps to reproduce

  1. Evaluate parseDeepLink("opencode://open-project?directory=/tmp/demo"); it returns /tmp/demo.
  2. Evaluate parseDeepLink("OPENCODE://open-project?directory=/tmp/demo").
  3. Observe that the equivalent uppercase link returns undefined.
  4. The same rejection occurs for OpenCode://new-session?directory=/tmp/demo.

Expected behavior: scheme casing should not change the parsed project directory or new-session request.

Screenshot and/or share link

Not provided; the parser calls above are the deterministic reproduction.

Operating System

All

Terminal

N/A

Activity

  1. sdivyanshu90 commented on Sep 19, 2026

    @sdivyanshu90
    ContributorAuthor

    Could you please review this issue?

  2. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    Thanks for the clear report and the RFC reference!

    The parseDeepLink function you describe, with its open-project/new-session links and the case-sensitive startsWith("opencode://") check, is part of OpenCode v1 (versions 0.x/1.x). v1 now only gets fixes for critical bugs, such as data loss, security problems or breakage with no workaround. Using the lowercase opencode:// scheme, the canonical form under RFC 3986, avoids this one, so it's unlikely to be fixed in v1.

    OpenCode v2 (@opencode/cli, versions 2.x) is a separate implementation and is where active development happens. Its desktop app parses the deep links it supports with new URL() and checks the parsed protocol, which already ignores scheme casing. We'd encourage upgrading to v2.

    If you think this is critical for your setup, or you can reproduce a case-sensitivity problem with deep links on v2, please reply here with the details and the v2 version you used.

  3. opencodejr commented on Oct 29, 2026

    @opencodejr
    Contributor

    We haven't heard back, so I'm closing this as not planned. The case-sensitive opencode:// check in parseDeepLink is in OpenCode v1, which only gets critical fixes, and using the lowercase scheme avoids the problem. If you can reproduce a scheme-casing problem with deep links on v2 (@opencode/cli, 2.x), please open a new issue with the v2 version and the link you used. Thanks again for the detailed report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions