Skip to content

Fall back to copy-to-clipboard for oversized plugin deeplinks#387

Merged
leerob merged 1 commit into
mainfrom
fix/deeplink-length-guard
May 15, 2026
Merged

Fall back to copy-to-clipboard for oversized plugin deeplinks#387
leerob merged 1 commit into
mainfrom
fix/deeplink-length-guard

Conversation

@pontusab
Copy link
Copy Markdown
Collaborator

@pontusab pontusab commented May 14, 2026

The Add to Cursor button generates cursor:// URLs that embed the entire rule or command content in the text= query param. For content beyond a few KB the resulting URL exceeds practical limits of OS protocol handlers and Cursor's own URL parser, producing two failure modes the user can hit in the wild: the protocol handler silently drops the dispatch ("no action"), or it truncates mid %XX sequence and Cursor's decodeURIComponent throws ("URI malformed").

Above an 8000-char URL threshold we now render the existing CopyButton instead of a broken Add to Cursor link, with a tooltip that explains the fallback. The threshold was picked empirically: a 4.6KB rule that produces a ~6.5KB URL is reported to install fine, while 15KB+ rules consistently fail. Long-term the editor side should accept either base64 (matching the MCP install path) or token references so very large rules can install without copy-paste.

Closes #363.


Note

Low Risk
Low risk UI behavior change that only affects client-side install links; main risk is the chosen URL-length threshold potentially misclassifying edge cases.

Overview
Prevents broken “Add to Cursor” actions for very large rules/commands by introducing a MAX_DEEPLINK_URL_LENGTH (8000) guard.

When a generated cursor:// deeplink exceeds the limit, the UI now renders a CopyButton (with an explanatory tooltip) instead of the deeplink, while keeping the normal deeplink flow for smaller payloads. CopyButton was extended to accept an optional title for the tooltip.

Reviewed by Cursor Bugbot for commit 39da865. Bugbot is set up for automated code reviews on this repo. Configure here.

The Add to Cursor button generates cursor:// URLs that embed the entire
rule or command content in the text= query param. For content beyond a
few KB the resulting URL exceeds practical limits of OS protocol handlers
and Cursor's own URL parser, producing two failure modes the user can
hit in the wild: the protocol handler silently drops the dispatch ("no
action"), or it truncates mid %XX sequence and Cursor's decodeURIComponent
throws ("URI malformed").

Above an 8000-char URL threshold we now render the existing CopyButton
instead of a broken Add to Cursor link, with a tooltip that explains the
fallback. The threshold was picked empirically: a 4.6KB rule that produces
a ~6.5KB URL is reported to install fine, while 15KB+ rules consistently
fail. Long-term the editor side should accept either base64 (matching
the MCP install path) or token references so very large rules can install
without copy-paste.

Closes #363.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cursor-directory Ready Ready Preview, Comment May 14, 2026 7:31pm

Request Review

@leerob leerob merged commit 750c96f into main May 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plugin auto-generated deeplink malformed or no-action

2 participants