feat(deep-links): make PostHog Code a Linear custom coding tool target#3577
Open
mateobelanger wants to merge 2 commits into
Open
feat(deep-links): make PostHog Code a Linear custom coding tool target#3577mateobelanger wants to merge 2 commits into
mateobelanger wants to merge 2 commits into
Conversation
Linear can launch custom coding tools from a URL template with
{{issue.identifier}} and {{context}} variables. Extend the existing
posthog-code://new deep link with optional source and issue params so
Linear-launched opens are attributed in analytics and carry the issue
identifier, add a Settings > Linear section with a copyable URL
template, and document the flow in DEEP-LINKS.md.
Generated-By: PostHog Code
Task-Id: 8c8167bc-4619-470c-a11c-b87b6012f6c7
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Closes #3576
Linear can open an issue directly in a coding tool (Settings → Code & reviews), and supports arbitrary tools launched from a URL template with
{{issue.identifier}}/{{context}}variables. PostHog Code wasn't set up as one of those tools, so there was no one-click path from a Linear issue into a prefilled task.Changes
Extends the existing
posthog-code://newdeep link so Linear can use it as a custom coding tool. Users paste this template into Linear (replacingOWNER/REPO):posthog-code://new?repo=OWNER/REPO&source=linear&issue={{issue.identifier}}&prompt={{context}}source(attribution, shared acrossnew/plan/issueroutes) andissue(external identifier, e.g.ENG-123) params, plusprompt_length_charstelemetry to catch OS-level URL truncation. No new route/hostname — Linear passes full context in{{context}}, so there's nothing to fetch (unlike the GitHubissueroute).promptgoes last in the template so truncation only ever clips prompt text.CopyableCommandcomponent out ofClaudeCodeSettings.docs/DEEP-LINKS.md.The Linear agents integration (delegate an issue → agent works it → activity streamed back) is out of scope here — it lives on the PostHog Django backend.
How did you test this?
pnpm typecheck,pnpm lint, andpnpm testpass locally. New unit cases coversource/issueparsing, rejection when neither prompt nor repo is present, unicode/newline round-trip, and analytics passthrough (new-task-link+newTaskLinkResolver).posthog-code-dev://new?repo=…&source=linear&issue=ENG-123&prompt=…and confirmed the main-process handler loggedsource: 'linear',hasIssue: true, correct repo and prompt length, and queued the pending link.Automatic notifications
Created with PostHog Code