Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(markdown): make known app deep links clickable #15722

Closedsuevalov(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/15722/headopened View on GitHub

Problem

Agent-authored Markdown links to desktop apps lose their destinations during rendering. Even if the renderer preserves the URL, Electron rejects the custom protocol, and mobile also removes the destination.

For example, [Open in app](linear://linear.app/example/issue/EXAMPLE-123) renders without a usable destination. This is a focused fix for broken links in the existing Markdown output workflow; all test URLs are synthetic.

Fix

  • Share an explicit allowlist for linear:, slack:, notion:, and obsidian:.
  • Preserve these destinations through both web Markdown sanitization paths.
  • Let Electron hand the allowed links to the OS, and preserve them for mobile’s native URL handler.
  • Keep unknown and executable schemes blocked and retain existing remote-editor URL restrictions.

This applies to provider-independent Markdown rendering on web, desktop, and mobile. Links open on the client device; server connection mode does not change that routing. No wire contracts or provider adapters change.

Verification

On macOS with Node v24.21.0:

pnpm exec vp test run packages/shared/src/externalAppLinks.test.ts apps/web/src/components/ChatMarkdown.test.tsx apps/desktop/src/electron/ElectronShell.test.ts apps/mobile/src/lib/markdownLinks.test.ts

All 108 tests passed. Regression tests cover inline links, reference links, and angle-bracket autolinks with raw HTML parsing enabled and disabled; each allowed app protocol; Electron handoff; mobile destination preservation; and rejection of unsupported schemes. The original Linear regression tests failed before the fix in both rendering modes, Electron, and mobile.

File-scoped vp lint completed without errors across the eight changed TypeScript files. It reported three existing React warnings in ChatMarkdown.tsx (set-state-in-effect, exhaustive-effect-dependencies, and static-components). File-scoped vp fmt --check passed for all nine changed files. git diff --check passed.

TypeScript checking was skipped because the available scripts are package-wide. Browser/native app execution and before/after screenshots were explicitly declined by the requester, so this PR has automated evidence only; actual OS app launch is not manually verified.

Model: OpenAI gpt-6-astra. Harness: OpenCode.

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — This PR adds a new cross-platform capability that turns four markdown schemes into links and allows the desktop app to invoke installed external applications, changing existing rendering and OS handoff behavior. A Medium-severity sanitizer issue also indicates mixed- or uppercase-scheme links can be dropped in raw-HTML mode.

      Not approved because:

      • 1 blocking correctness issue found at or above your repo's Minimum Blocking Severity
      Adjust the Minimum Blocking Severity for this repo — including turning it Off — in [Settings](https://app.macroscope.com/pingdotgg/settings#Repos). You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

      Important

      Review skipped

      Review was skipped as selected files did not have any reviewable changes.

      ⚙️ Run configuration
      • Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml
      • Review profile: CHILL
      • Plan: Advanced
      • Run ID: 0420c9f7-d009-4689-86e1-10a5c6656bf1
      📥 Commits

      Reviewing files that changed from the base of the PR and between 15ba00f19fda9a79b2ff1a5abae823cbbfc2ab49 and b6ce66ebc5e44f517f862078b82f671c1ffe425a.

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration
      • Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml
      • Review profile: CHILL
      • Plan: Advanced
      • Run ID: a1d5f029-6515-45c5-ba67-42b509e13812
      📥 Commits

      Reviewing files that changed from the base of the PR and between 39b7752669e09759ddc1849c7cea22b04bc32d07 and 15ba00f19fda9a79b2ff1a5abae823cbbfc2ab49.

      📒 Files selected for processing (2)
      • apps/web/src/components/ChatMarkdown.test.tsx
      • apps/web/src/components/ChatMarkdown.tsx

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.


      📝 Walkthrough

      Walkthrough

      The shared package adds recognition for Linear, Slack, Notion, and Obsidian URL schemes. Desktop external URL handling and web and mobile markdown link handling use that recognition. Tests cover recognized schemes and rejected destinations.

      Changes

      External app links

      Layer / File(s)Summary
      Define supported external-app schemes
      packages/shared/src/externalAppLinks.ts, packages/shared/package.json, packages/shared/src/externalAppLinks.test.ts
      The shared package exports a predicate and scheme list for Linear, Slack, Notion, and Obsidian links. Tests cover supported and rejected inputs.
      Preserve external-app links in markdown
      apps/web/src/components/ChatMarkdown.tsx, apps/web/src/components/ChatMarkdown.test.tsx, apps/mobile/modules/t3-markdown-text/src/markdownLinks.ts, apps/mobile/src/lib/markdownLinks.test.ts
      Web sanitization and URL transformation, and mobile link presentation, preserve recognized app destinations. Tests cover supported links and rejected schemes.
      Accept external-app links in Electron
      apps/desktop/src/electron/ElectronShell.ts, apps/desktop/src/electron/ElectronShell.test.ts
      Electron external URL parsing accepts recognized app links. Tests check that supported links reach the OS handler and unsupported schemes do not.

      Priority: ➖ Normal

      Estimated code review effort: 3 (Moderate) | ~20 minutes

      Change: Bug fix

      Suggested reviewers: juliusmarminge

      Merge Risk: ⚪ Minimal · up to 15ba0

      This change makes Linear, Slack, Notion, and Obsidian links clickable while keeping unsafe and unknown schemes blocked. No merge-blocking risk was found. Actual OS app launch was not manually verified.

      Security Architecture Review

      Security architecture risk: 🔵 Low · up to 15ba0

      The explicit four-scheme allowlist keeps the change bounded, and existing desktop restrictions remain in place. However, matching URLs can now reach installed applications with their full payloads. Those applications’ actions and confirmation behavior are not established, so this is a small trust-boundary expansion rather than only a rendering fix.

      Retained concerns No architecture-level concerns identified.

      Security review details

      Security Blast Radius

      • inferred — The demonstrated handoff acts on the client device rather than a connected server. Consequences depend on the registered application and its local user authority; access to application accounts, files, or other assets was not established.

      Security Findings and Attack Paths

      • inferred — A party influencing rendered Markdown can choose the full payload of an allowed app URL and its visible label. The demonstrated normal path proceeds through link interaction to local dispatch. Whether a payload can cause a privileged or destructive application action remains unresolved; this is not an established exploit.

      Trust Boundaries and Controls

      • observed — The inspected desktop window interception and external-opening IPC handler enforce URL acceptance but do not themselves require activation provenance or show a destination-action confirmation. The changed gate therefore delegates accepted app payloads to external handlers without action-specific authorization at this layer.

      Resilience and Maintainability Implications

      • inferred — Centralizing the scheme list reduces platform policy drift, but future additions to that list can simultaneously expand Markdown preservation and desktop OS handoff. Such additions warrant review of handler authority, not only rendering compatibility.

      Hardening Proposals

      • proposed — Document the intended URI action families for each allowed app. If any supported handler exposes sensitive state changes, consider action-specific URI restrictions or an explicit destination-and-action confirmation before dispatch. This is a hardening proposal, not a verified defect.
      🚥 Pre-merge checks | ✅ 4 | ❌ 1

      ❌ Failed checks (1 warning)

      Check nameStatusExplanationResolution
      Docstring Coverage⚠️ WarningDocstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 8 files.Write docstrings for the functions missing them to satisfy the coverage threshold.
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Title check✅ PassedThe title clearly and concisely describes the main change: making known app deep links clickable in Markdown.
      Description check✅ PassedThe description explains the problem, the cross-client fix, and focused verification results. It uses “Fix” instead of the template’s “Change” heading and does not link to an approved issue or discuss…
      Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create a new PR
      • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

      Comment `@coderabbitai help` to get the list of available commands.
    4. The mixed-case sanitizer finding is fixed in 15ba00f19f and the review thread is resolved. CodeRabbit completed its review of that commit with no actionable findings. Local verification: all 59 ChatMarkdown tests passed; file-scoped lint has no errors and formatting passed.

      The latest CI workflow is currently action_required, so the required Test/Check and other CI statuses have not been produced. Could a maintainer approve the fork workflow run? https://github.com/pingdotgg/t3code/actions/runs/37222708295

      Macroscope’s earlier approvability summary also still refers to the corrected finding; its follow-up bot rejected my request due to repository permissions.

    5. pvckry(GitHub profile, opens in a new tab)commented

      Could this use a user-configurable external-link policy, rather than a fixed list of four apps?

      I have the same failure with lens:// links on macOS which are part of a local app I've built. Opening the actual link through macOS works, but clicking it in T3 chat does nothing. The HTTPS fallback works. Adding Lens to this list would solve my immediate case, but the next custom scheme would need another code change. #16822 shows a similar gap for editor links.

      Suggested direction:

      • Keep existing handling for web URLs, local files, and T3's internal links. For native-app schemes, let users add/remove approved schemes in settings, so private tools such as Lens work without a T3 release.
      • For an unapproved app scheme, offer an explicit “Open in app” action showing the full destination, with Open once / remember approval / Cancel. Preserve the destination in a safe internal representation rather than stripping it or making arbitrary raw HTML URLs directly navigable.
      • Apply the policy at the native dispatch boundary as well as in rendering. Require deliberate user interaction; keep executable/embedded-content schemes blocked and retain existing editor-specific restrictions. An installed OS handler should establish availability, not automatic trust. Electron's external-opening guidance is relevant here.
      • Hand approved links to the client device's existing OS handler and show a useful error if there is no handler or opening fails. Do not navigate the chat/embedded frame to the custom URI.

      Could this PR support configurable schemes, or could that be tracked as a follow-up? A synthetic lens:// regression case would help cover preservation through Markdown/HTML sanitization and native handoff, alongside mixed-case schemes, cancellation, blocked schemes, and missing-handler failures.

    6. Note

      This comment is posted by Julius' dot

      Closing for missing UI verification. The PR changes Markdown link destinations across web, desktop, and mobile, but its Verification section explicitly says browser/native execution and before/after screenshots were declined and actual OS launch was not checked. The focused automated tests are useful, but the verification rule also requires before/after UI screenshots and a short recording when interaction is needed to demonstrate the behavior. Attach those showing a supported link reaching the client app, document the observed result and limitations, then request reconsideration.

    7. juliusmarminge closed this

Sign in to join this conversation.