Skip to content

[FEATURE]: opencode://new-session in OpenCode 2's desktop app, as in OpenCode 1 #55106

Open

Description

@Xrpfant

OpenCode 1's desktop app handled opencode://new-session?directory=<dir>&prompt=<text>. A setup command could sign the user in and then open a new session in their project, on the configured model, with a first message.

OpenCode 2's desktop app (v2.0.27) still registers opencode://, but reads only opencode://console/authorized (packages/desktop/src/main/.../deep-link.ts). Every other link is passed to the page as window.__OPENCODE__.deepLinks and an opencode:deep-link event, and nothing in packages/app reads either. The app then reopens its window's last-active-url. There are no launch arguments for a directory or a new session either.

Ask: handle opencode://new-session?directory=&prompt= again (an optional model= would help too), opening a new draft session in that directory.

Related: #53529 (open existing sessions as Desktop tabs from API clients).

Activity

  1. opencode-agent commented on Oct 13, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed request, @Xrpfant!

    To restate it: you'd like the OpenCode 2 desktop app to handle opencode://new-session?directory=<dir>&prompt=<text> again, ideally with an optional model=, and open a new draft session in that directory with the prompt filled in, the way OpenCode 1 did. That would let a setup command sign the user in and then drop them straight into their project.

    I checked, and it matches what you found. On v2 the desktop app only handles opencode://console/authorized. Other links reach the page, but nothing acts on them yet. This can't be done with a plugin either, because handling the link happens in the desktop app, not in the server where plugins run. Maintainers will consider it.

    Related issues and PRs:

  2. ahatzz11 commented on Nov 1, 2026

    @ahatzz11

    Still the case in desktop 2.2.5 on macOS:

    open "opencode://new-session?directory=$HOME/code/hex&prompt=hello%20from%20hex"
    

    The app comes to the front, but it reopens the last-used project on an empty new-session view. The directory and prompt are both dropped, whether the app was already running or not.

    Another use case: Hex's Output pane wants an "Edit with agent" button that opens a fresh OpenCode session with a prompt already typed in but not sent (anomalyco/hex#789). This link, opening a draft rather than sending, is exactly what it needs.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions