Repository navigation
feat(app): open a session from an opencode:// link - #59061
kitlangton wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
The change looks sound and I have nothing blocking. I couldn't run it end to end: a real opencode:// link needs the desktop app and the OS link handler. The new link, resolution and notification tests pass (10/10), and tsc -b is clean in packages/app and packages/desktop. On reading, a link that launches the window is held until the app subscribes. Resolution falls back correctly when the named server is missing, lacks the session, or is down: the 3 s timeout bounds each probe and the rest run in parallel. Subagent links open in the root session's tab, routed to the subagent.
Public API: adds the opencode://session/<sessionID>[?server=<origin-or-key>] link format to the desktop app. It removes the opencode:deep-link DOM event and the window.__OPENCODE__.deepLinks global; nothing in the repository used either, so this is backwards compatible. The new onOpenLink hook on Platform is internal to the app.
There was a problem hiding this comment.
The new commit looks correct; nothing new to raise. Opening a session now gives the tab the same route it saves. Clicking a root-session notification therefore leaves a subagent the tab was showing, where before the tab saved the root route but still navigated to the subagent. Notifications for subagents themselves are unaffected, because the callers skip sessions with a parent. I read the change and ran the links and notifications tests in packages/app (10/10 pass); tsc -b is clean. The public API is unchanged since my last review.
c0434f6 to
777124e
Compare
There was a problem hiding this comment.
The new commits look correct; nothing new to raise. A new link tab is now added with its route, so the route can't be lost while the tab joins the store, and an existing tab still gets the route saved and selected. Parent sessions already in the local cache aren't fetched again. I read the changes and ran the links and notifications tests in packages/app (10/10 pass); tsc -b is clean in packages/app and packages/desktop. The public API is unchanged since my last review.
777124e to
0f3dd87
Compare
There was a problem hiding this comment.
This push only rebases the branch onto a newer dev; none of the pull request's own files changed, and I have nothing new to raise. The links and notifications tests in packages/app still pass (10/10). The public API is unchanged since my last review.
0f3dd87 to
0476780
Compare
There was a problem hiding this comment.
This push rebases onto a newer dev; nothing new to raise. The pull request's own changes only shift around dev's new code (<SessionLinks /> now mounts next to <VoiceProvider>). The links and notifications tests in packages/app still pass (10/10), and tsc -b is clean in packages/app and packages/desktop. The public API is unchanged since my last review.
Another app can now open a specific OpenCode session with an
opencode://session/<id>link.The desktop app already catches
opencode://links, but nothing inside it did anything with them. Links only navigate: they never send a prompt, run anything, or add a server.🔍 Origin: requested in #44167
💡 Why: a task board or script has no way to jump straight to a session in the desktop app.
🆕 Now you can
opencode://session/<sessionID>and land on that session in a tab. An open tab for it is reused.?server=<origin-or-key>to say which server holds it. Without it, every connected server is asked at once and the first to have it wins.📊 Proof: tested by hand in a packaged build on a fresh macOS VM (before the latest rebase), together with #59058.
10 unit tests pass (link parsing, server choice, subagent routing).
👀 Read:
shell/links/(server choice and the 3 s probe timeout) andopenNotificationSession, which now takes an optional child route and adds a new tab with its route set so the tab store can't drop it. Web has noonOpenLink, so nothing changes there. The rest is routine.Works without #59058: the app validates links on its own, and #59058 adds the desktop-side checks and window choice.
Checks run
bun test --conditions=solid --isolate --preload ../ui/test/solid-jsx.ts --preload ./happydom.ts src/shell/links src/shell/notifications/notification.test.ts(packages/app): 10 passbun typecheck(packages/app): cleanbun run check(lint and typecheck): passAdded by the opencode bot (AI-generated).
Fixes #44167
Related: #53529, #55106, #56471
Public API: adds the
opencode://session/<id>[?server=…]desktop deep link; removes the unusedopencode:deep-linkDOM event andwindow.__OPENCODE__.deepLinksglobal (backwards compatible)