Repository navigation
feat(linear): import Linear issues into new thread drafts - #7065
Closed
maslinedwin wants to merge 8 commits into
Closed
maslinedwin wants to merge 8 commits into
maslinedwin wants to merge 8 commits into
Conversation
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.
Redo of #3711 for current
main, scoped to the original request (discussion #6752).@juliusmarminge you asked to port this after #2829. This version does not touch orchestration at all, so it does not need to wait on V2 and will not need another rebase when V2 lands.
Why this is different from #3711
#3711 was a 3.6k-line two-way integration wired into V1 decider/projector/reactors (
LinearSyncReactor, migration 033, 14 RPCs, mobile, forkapp.config). You closed it because those files are going away — not because the product is unwanted.This PR is read-only import only:
ServerSecretStorewith aT3CODE_LINEAR_API_TOKENenv fallback. Never returned to the client.linear.authStatus,linear.searchIssues,linear.fetchIssues,linear.setToken,linear.clearToken. Reads are read-scope; token writes are operate-scope.<linear_issue>block and defangs delimiter collisions.Intentionally not in this PR (follow-ups if you want them): status write-back, thread↔issue persistence,
/linearbulk browser, mobile, OAuth.Architecture
LinearApifollowsBitbucketApi: EffectContext.Service,HttpClientGraphQL, tagged errors. Import uses the existinguseNewThreadHandler+composerDraftStore.setPromptpath, so it does not depend on V1 or V2 internals.Review lessons from #3711 baked in from the start:
Effect.catchTagsfor known recoveriesTesting
tsgo --noEmitclean in contracts, client-runtime, server, webformatLinearIssues+ injection defusal)RpcAuthorizationcoverage of the new methods)Screenshots
I can add a short screen recording of Settings connect + palette import on request.
Related: complementary to #4115 (composer chips). This one creates a new thread from selected issues, matching Conductor’s “create from Linear” flow.
Note
Medium Risk
Stores and uses Linear API tokens server-side and adds new authenticated RPC surface area; prompt formatting mitigates injection but imported issue text still flows into the model context.
Overview
Adds read-only Linear import: connect a personal API key on the server, search/fetch issues over GraphQL, and prefill a new draft thread from the command palette—no orchestration or write-back.
Server & contracts: New
LinearApiservice (token inServerSecretStore, optionalT3CODE_LINEAR_API_TOKENenv), five WS RPCs with read vs operate auth, shared schemas/errors in contracts, and unit tests for auth edge cases and partial fetches.Web: Settings → Linear for connect/disconnect; Import from Linear in the command palette opens a dialog (search, multi-select up to 20, combine vs subtasks, target folder).
useLinearImportfetches details and sets the composer viaformatLinearIssues, which wraps issue text in an untrusted<linear_issue>block and defangs delimiter injection.Reviewed by Cursor Bugbot for commit b7b3703. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add Linear issue import into new thread drafts via search dialog and settings panel
LinearApiservice on the server withprobeAuth,searchIssues,fetchIssues,setToken, andclearTokenoperations, exposed as WebSocket RPCs with read/operate scope enforcement.combineorsubtasks), and a LinearSettingsPanel at/settings/linearfor token management.formatLinearIssuesin linearFormat.ts to render issue content as delimiter-safe prompt text before writing it into the composer draft store.LinearAuthError,LinearRequestError,LinearTokenStoreError) for all Linear operations.Macroscope summarized b7b3703.