Repository navigation
feat(linear): customizable launch-prompt template for Linear worktrees - #10159
octawizard wants to merge 8 commits into
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Nice work, thanks!! 👍 |
📝 WalkthroughWalkthroughAdds a configurable Linear launch prompt template setting with 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/renderer/src/lib/launch-work-item-direct-draft.test.ts (1)
7-11: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAvoid
as neverfor the work-item fixtures.These casts suppress all compile-time validation, so changes to
LaunchableWorkItemcan silently leave these tests with invalid inputs. Use a typed fixture/factory with defaults, or construct an object checked againstLaunchableWorkItem.Also applies to: 20-24
src/renderer/src/i18n/locales/en.json (1)
6883-6887: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winNew Linear locale keys look hand-typed rather than real SHA1 hashes.
Based on learnings, new i18n entries in this repo should be auto-keyed via
SHA1(file path + source text). The new keys here (a1b2c3d4e5,b2c3d4e5f6,c3d4e5f6a7, …) form an obviously sequential hex pattern rather than a hash digest, andc3d4e5f6a7is reused verbatim across two different file paths (TasksPanevstasks.search) for the same text — a real path+text SHA1 would differ between those namespaces. This risks failingpnpm run sync:localization-catalog/pnpm run verify:localization-catalogor getting silently regenerated with different keys later.
src/renderer/src/i18n/locales/en.json#L6883-L6887: regenerate these keys (and the matchingL8527-L8535block) via the project's key-generation tooling instead of hand-written hex strings.src/renderer/src/components/settings/TasksPane.tsx#L201-L227: update thetranslate(...)calls to use the regenerated keys onceen.jsonis fixed.src/renderer/src/components/settings/tasks-search.ts#L26-L39: update thetranslateSearchKeyword(...)/translate(...)calls to use the regenerated keys onceen.jsonis fixed.Source: Learnings
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: c6b64a52-d001-4fad-b107-bd22d63517c2
📥 Commits
Reviewing files that changed from the base of the PR and between 8a23618 and 73fb9e2b1955488854b9ae5552085337d3fc236d.
📒 Files selected for processing (19)
src/renderer/src/components/settings/TasksPane.test.tsxsrc/renderer/src/components/settings/TasksPane.tsxsrc/renderer/src/components/settings/tasks-search.tssrc/renderer/src/components/sidebar/folder-workspace-composer-submit.tssrc/renderer/src/hooks/useComposerState.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/lib/github-work-item-background-request.tssrc/renderer/src/lib/launch-work-item-direct-draft.test.tssrc/renderer/src/lib/launch-work-item-direct-draft.tssrc/renderer/src/lib/launch-work-item-direct.tssrc/renderer/src/lib/linked-work-item-context.test.tssrc/renderer/src/lib/linked-work-item-context.tssrc/shared/constants.test.tssrc/shared/constants.tssrc/shared/types.ts
- resolveQuickCreateLinkedWorkItemPrompt: don't fall back to the raw Linear
URL when a non-blank custom template renders empty (matches the composer
path); add {{missing}} regression test
- regenerate i18n keys as sha1("<path>:<text>") for TasksPane + tasks-search
across all five locales; dedupe the Linear header to the existing key
- launch-work-item-direct-draft.test: replace `as never` casts with a typed
LaunchableWorkItem fixture
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
73fb9e2 to
227b8f7
Compare
|
Amazing! 🙌 |
…s (adopt #10159) Adopt upstream stablyai/orca#10159: new global setting linearLaunchPromptTemplate with {{identifier}}/{{url}} placeholders, editable in Settings -> Tasks -> Linear. Empty template preserves current behavior byte-for-byte; unknown tokens drop their line. Closes the last provider gap vs GitHub/GitLab/Jira.
Summary
Makes the first instruction Orca injects when launching a worktree from a Linear issue customizable, via a new global setting
linearLaunchPromptTemplatewith{{identifier}}and{{url}}placeholders.Today that text is hardcoded to
Linked Linear issue: <ID>\n<URL>. Linear is the only task provider whose launch prompt isn't already customizable — GitHub/GitLab/Jira all flow through theissueCommandtemplate, while Linear is routed to a fixed builder.Relates to #9066 (the Linear portion of "customizable task worktree prompt").
Behavior
{{identifier}}(e.g.TEAM-1234) and{{url}}. Unknown{{…}}tokens cause their line to be dropped so no literal placeholder leaks into the prompt.defaultLinearTeamSelection/commitMessageAi.customPromptprecedent.Changes
GlobalSettings.linearLaunchPromptTemplate(default''); no main-process changes needed (the settings merge + IPC pass plain strings through).buildLinearLaunchContextBlock, kept pure — the template is passed as an argument and threaded through its wrappers into all four Linear launch paths: the new-workspace composer, the direct "Use" launch, and folder-workspace quick-create.Screenshots
Adds a "Launch prompt template" textarea under Settings → Tasks → Linear. I couldn't capture a screenshot locally (the app's macOS-native bindings aren't installed in my environment), so a screenshot is pending. No other UI changes.
Testing
pnpm lint— clean on all changed files. Note: one pre-existing, unrelatedno-useless-returnerror exists inWorktreeCard.tsxonmain.pnpm typecheck— not run (nativetscbinary unavailable in my environment); type-correctness verified by reading signatures/usages.pnpm test(affected suites) — 105+ tests pass across the changed areas;verify:localization-catalogandverify:localization-coveragepass. Full suite not run.pnpm build— not run.null, default preservation), the direct-launch draft helper, the settings pane, and a{{missing}}regression test.AI Review Report
Reviewed via a subagent-driven flow (per-task spec + quality reviews and a whole-branch review) plus an external CodeRabbit pass. Dimensions checked: template-rendering and
null-handling correctness, completeness of threading the setting through all four Linear launch paths (composer ×2, direct launch, folder-workspace quick-create), purity of the builder, and the GitHub background caller's argument cast. CodeRabbit flagged one correctness item (URL fallback when a custom template renders empty) and two nitpicks (i18n key generation, test typing) — all addressed.Cross-platform: this change is renderer-only (React + the settings store) with no OS-specific code — no keyboard shortcuts, UI labels, file paths, shell behavior, or Electron platform branches are touched, so macOS/Linux/Windows behave identically.
Security Audit
Low risk. The feature substitutes a user-authored, global setting into the user's own agent launch prompt as plain text — no shell/command execution, no
eval, no path handling, no auth or secrets. Placeholder substitution usessplit/join(no regex-injection surface) and drops lines with unresolved{{…}}tokens so no literal placeholder leaks. IPC is the existingsettings:get/settings:setchannel carrying a plain string — no new surface. No dependency changes.Notes
es/ja/ko/zhcatalogs use the English text as a fallback until the translation pipeline fills them in.verify:localization-catalogparity passes.resolveQuickCreateLinkedWorkItemPrompt(...)call intentionally keeps its first argument on the opening-paren line — an existing test asserts that literal source substring.ELI5
The first message injected when creating a worktree from a Linear issue was hardcoded. A setting lets you customize that launch prompt with identifier and URL placeholders, like other issue providers.