GeezerVison is showing github.com — Add a deep link to open a specific Desktop session · Issue #44167 · anomalyco/opencode
Add a deep link to open a specific Desktop session #44167DescriptionSupport deep links that open a particular session in OpenCode Desktop. Reacted by filantus, David Lee, 大神带我来搬砖, jornamon and David Percy ActivityTheCrazyLex commented on Oct 14, 2026 This would be really useful. Anything that lists OpenCode sessions outside the app (launchers, scripts, trackers) has the session id but no way to open that session in Desktop. Claude, Codex and OpenChamber (openchamber://session/<id>) all support this already.
On v2.0.29 and dev, the desktop app only handles opencode://console/authorized, and nothing listens for the opencode:deep-link event the renderer dispatches. #54187 looks like it would cover it.
@Hona @Brendonovich, would you be open to reviewing #54187 for this? zjm54321 commented on Nov 17, 2026 A data point from outside Desktop, since #64180, #59061 and #59058 are about to settle the shape.
I maintain FluentCode, a native Windows client for the OpenCode server. It is getting session links now, and it will write and read opencode://session/<sessionID>, the form all three pull requests share. Two mobile clients already open the same form (grapeot/opencode_ios_client, grapeot/opencode_android_client), and OpenChamber has the same idea under its own scheme (openchamber://session/<id>, with ?message=<id>). So this link is turning into a convention between clients, not only a Desktop feature.
When it lands, could the docs carry a short description that other clients can follow? These are the points where clients differ today:
- Grammar.
opencode://session/<sessionID>, scheme and host in any letter case, and what counts as a valid id.
- Query parameters. feat(app): open a session from an opencode:// link #59061 has
?server=<origin-or-key>, refactor(desktop): simplify deep links and open sessions by id #64180 has none, and the two mobile clients reject a link that has any query. A rule such as "readers ignore parameters they do not know" would keep one client's link working in the next.
- What a link may do. feat(app): open a session from an opencode:// link #59061 puts it well: links only navigate, they never send a prompt, run anything or add a server. Worth stating as a rule for every reader.
- Which server. The id names no server, so a reader asks the servers the user has already added. If a
server hint stays, it should only choose among those.
- More than one handler on a machine. On Windows the user picks one default app per scheme. If that app is a third-party client, Desktop's
opencode://console/authorized?window=… return lands there. FluentCode plans to pass on opencode:// links it does not understand to the other registered handler, but a note on which shapes belong to Desktop alone would let every client do the right thing.
Happy to test a Desktop build against FluentCode once one of the pull requests is in. k0d3d commented on Nov 26, 2026 Adding a plugin-author data point, since I'm building a plugin around Desktop session links.
With @opencode/plugin 2.4.1, the last mile is already available: a GUI plugin can call ctx.tabs.open({ server, id }, { focus: true }), which opens an existing session as a Desktop tab (background by default) and reuses the tab when it is already open. So plugins do not need a new navigate-to-session API just to open the session.
What is still missing is a supported way to receive the link. The main process accepts opencode:// URLs and the renderer dispatches opencode:deep-link, but the GUI plugin SDK exposes no subscription for that event (no ctx.links.on(...), ctx.deeplinks.on(...), or equivalent). A plugin can install its own Electron open-url listener in main(ctx), but that is undocumented plumbing and there is no supported main-to-window path beyond a custom Ipc. Please expose a first-class deep-link event/intent to GUI plugins.
Two related points:
- Please document the link grammar, including
?message=<id> and tolerance for unknown query parameters, as suggested above. If [FEATURE]: Let GUI plugins add per-message actions and reveal a message in the timeline #61385's proposed ctx.sessions.reveal({ sessionID, messageID }) lands, the same link form could address a specific message as well as a session.
- TUI compatibility is straightforward:
opencode --session <id> and ui.router.navigate({ type: "session", sessionID }) already exist; there is still no message-level route.
Environment: OpenCode v2.4.0, @opencode/plugin 2.4.1, Linux.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|