Skip to content

[Feature]: Open a specific desktop thread via t3code:// #4996

Description

@danyeah

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I am describing a concrete problem or use case, not just a vague idea.

Area

apps/desktop

Problem or use case

T3 Code already exposes thread deep links as /threads/<environmentId>/<threadId>, and the mobile app uses t3code://threads/<environmentId>/<threadId> for widgets and notification navigation.

On macOS, T3 Code is registered as the handler for the t3code scheme, but opening such a URL does not currently navigate the desktop app to the matching thread. The desktop app can be brought to the foreground, but the user still has to manually locate the conversation.

This prevents integrations such as a hardware controller, menu-bar status app, notification action, or other local automation from taking the user directly to the thread that needs attention.

Proposed solution

Support a documented desktop deep link for an existing thread:

t3code://threads/<environmentId>/<threadId>

When received, the desktop app should reveal/focus its main window and navigate through the existing typed renderer route:

/$environmentId/$threadId

With Electron's hash history this is represented as #/<environmentId>/<threadId> internally; the external/mobile contract can remain t3code://threads/....

The behavior should work when the app is already running and when it is launched through the link.

Why this matters

This brings desktop behavior in line with the existing mobile deep-link model and enables fast "attention -> exact conversation" workflows.

For example, I am building a small read-only MIDI controller integration: each pad represents a live T3 thread and its LED reflects its state. Pressing a pad can already focus T3 Code on macOS; opening the corresponding thread would make the interaction immediate and useful without relying on brittle GUI scripting or storing credentials.

Smallest useful scope

  • Handle open-url on macOS.
  • Handle the protocol URL passed to a second desktop instance on Windows/Linux.
  • Parse only the t3code://threads/<environmentId>/<threadId> shape.
  • Reveal the main window and forward the validated destination to the renderer.
  • Navigate via the existing thread route after the renderer is ready.
  • Ignore malformed or unsupported URLs safely.

No server API or authentication change is required.

Alternatives considered

  • AppleScript/UI automation to search for and click a thread: fragile, locale-dependent, and requires Accessibility permission.
  • Focusing the app only: this works today but still leaves the user to locate the correct chat.
  • Opening the remote web UI: does not provide the native desktop workflow.

Risks or tradeoffs

The implementation needs to handle cold-start timing, duplicate URL events, and invalid or unavailable environment/thread IDs. The deep-link format should be treated as a stable public contract once documented.

The desktop renderer uses hash history, so the handoff should navigate through the renderer rather than assuming arbitrary external t3code:// URLs are already renderer routes.

Examples or references

  • packages/shared/src/agentAwareness.ts builds /threads/<environmentId>/<threadId>.
  • apps/mobile/src/widgets/AgentActivity.tsx turns that route into t3code://threads/<environmentId>/<threadId>.
  • apps/web/src/main.tsx uses hash history under Electron.
  • apps/desktop/src/app/DesktopClerk.ts already handles a second desktop instance by revealing the main window.
  • Related: [Feature]: Deep link (t3code://checkout-pr) to open the PR-checkout dialog from outside the app #4625 proposes a different desktop deep-link (t3code://checkout-pr) and identifies the same missing external URL-routing layer.

Contribution

  • I would be open to helping implement this.

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