anomalyco / anomalyco/opencode

[Bug][Desktop v2] Middle-clicking a subagent opens a separate Not Found window

Open
#38,949 0 comments 0 reactions 1 assignee View on GitHub

@Brendonovich is already working on this.

Since Jul 26, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

In the Desktop v2 interface, middle-clicking a subagent/task card does not open the child session as a new OpenCode tab while keeping the parent tab. Instead, it opens a separate OpenCode-like window/page and displays Not Found.

A normal click can navigate to the child session in the current app. The failure is specific to the middle-click/new-tab path.

Plugins

oh-my-openagent (v4.19.1, personally forked)

OpenCode version

1.18.4

Steps to reproduce
  1. Open an existing session that contains a completed or running subagent/task card.
  2. Ensure the Desktop v2/new layout is enabled.
  3. Middle-click the subagent/task card.
  4. Observe that a separate OpenCode-like window/page is opened instead of a new tab in the existing window.
  5. Observe Not Found in the new window/page.
Expected behavior

The parent session remains available in its current tab, and the child session opens in a new OpenCode tab in the same Desktop window, matching the behavior of middle-clicking a session from the Home session list.

Actual behavior

The native link behavior escapes the in-app tab system and opens a separate window/page. The new page cannot render the child route and shows Not Found.

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

OpenCode Desktop (not applicable)

Additional context

This appears to be a stock OpenCode GUI issue rather than an oh-my-openagent issue:

  • The task card is rendered as a native <a> by packages/session-ui/src/components/basic-tool.tsx.
  • packages/session-ui/src/components/message-part.tsx only intercepts button === 0; middle-click returns before preventDefault() and before the app tab store is used.
  • The Home session list already has an onAuxClick path that calls tabs.addSessionTab().
  • The child URL shape and /server/:serverKey/session/:id route are valid for the normal in-app navigation path.
  • The Desktop Electron shell does not configure a setWindowOpenHandler for this native middle-click path.

Potential fix: handle middle-click/auxclick on the task card and add the child session through the existing app tab store, then add a Desktop v2 regression test covering parent-tab preservation and child-tab opening.

Related reports/changes: #34808, #35577, #15077, and the middle-click feature added in v1.17.19.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.