Skip to content

feat(linear): customizable launch-prompt template for Linear worktrees - #10159

Open
octawizard wants to merge 8 commits into
stablyai:mainfrom
octawizard:feat/linear-launch-prompt-template
Open

octawizard wants to merge 8 commits into
stablyai:mainfrom
octawizard:feat/linear-launch-prompt-template

Conversation

@octawizard

@octawizard octawizard commented Jul 23, 2026 •

Copy link
Copy Markdown

Summary

Makes the first instruction Orca injects when launching a worktree from a Linear issue customizable, via a new global setting linearLaunchPromptTemplate with {{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 the issueCommand template, while Linear is routed to a fixed builder.

Relates to #9066 (the Linear portion of "customizable task worktree prompt").

Behavior

  • Empty template = today's behavior, byte-for-byte (the default). Nothing changes unless a user sets a template.
  • Placeholders: {{identifier}} (e.g. TEAM-1234) and {{url}}. Unknown {{…}} tokens cause their line to be dropped so no literal placeholder leaks into the prompt.
  • Editable in Settings → Tasks → Linear → Launch prompt template. The built-in default shows as the field placeholder; clearing the field resets to default.
  • Global setting (a Linear workspace typically spans many repos), following the defaultLinearTeamSelection / commitMessageAi.customPrompt precedent.

Changes

  • New optional GlobalSettings.linearLaunchPromptTemplate (default ''); no main-process changes needed (the settings merge + IPC pass plain strings through).
  • Template rendering added to 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.
  • New textarea in the Tasks settings pane + i18n across all five locale catalogs.

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, unrelated no-useless-return error exists in WorktreeCard.tsx on main.
  • pnpm typecheck — not run (native tsc binary unavailable in my environment); type-correctness verified by reading signatures/usages.
  • pnpm test (affected suites) — 105+ tests pass across the changed areas; verify:localization-catalog and verify:localization-coverage pass. Full suite not run.
  • pnpm build — not run.
  • Added/updated high-quality tests: rendering (substitution, empty-line + unresolved-placeholder dropping, 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 uses split/join (no regex-injection surface) and drops lines with unresolved {{…}} tokens so no literal placeholder leaks. IPC is the existing settings:get/settings:set channel carrying a plain string — no new surface. No dependency changes.

Notes

  • Renderer-only; no platform-specific behavior.
  • All locales are kept in English for the new strings — no translations were added; the es/ja/ko/zh catalogs use the English text as a fallback until the translation pipeline fills them in. verify:localization-catalog parity passes.
  • One 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.

@vmorenog

vmorenog commented Jul 23, 2026 •

Copy link
Copy Markdown

Nice work, thanks!! 👍

@octawizard
octawizard marked this pull request as ready for review July 23, 2026 10:40
@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a configurable Linear launch prompt template setting with {{identifier}} and {{url}} placeholders. The Tasks settings pane persists edits on blur and exposes localized search metadata. Template rendering substitutes placeholders, removes empty or unresolved lines, and supports default behavior for blank templates. Composer, sidebar, and direct launch flows pass the setting into prompt generation, with tests covering persistence, substitution, fallback, and default settings.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 21.43% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: a customizable Linear launch-prompt template for worktrees.
Description check ✅ Passed The description follows the template and includes summary, screenshots, testing, AI review, security audit, and notes with cross-platform coverage.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Avoid as never for the work-item fixtures.

These casts suppress all compile-time validation, so changes to LaunchableWorkItem can silently leave these tests with invalid inputs. Use a typed fixture/factory with defaults, or construct an object checked against LaunchableWorkItem.

Also applies to: 20-24

src/renderer/src/i18n/locales/en.json (1)

6883-6887: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

New 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, and c3d4e5f6a7 is reused verbatim across two different file paths (TasksPane vs tasks.search) for the same text — a real path+text SHA1 would differ between those namespaces. This risks failing pnpm run sync:localization-catalog / pnpm run verify:localization-catalog or getting silently regenerated with different keys later.

  • src/renderer/src/i18n/locales/en.json#L6883-L6887: regenerate these keys (and the matching L8527-L8535 block) via the project's key-generation tooling instead of hand-written hex strings.
  • src/renderer/src/components/settings/TasksPane.tsx#L201-L227: update the translate(...) calls to use the regenerated keys once en.json is fixed.
  • src/renderer/src/components/settings/tasks-search.ts#L26-L39: update the translateSearchKeyword(...)/translate(...) calls to use the regenerated keys once en.json is 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.tsx
  • src/renderer/src/components/settings/TasksPane.tsx
  • src/renderer/src/components/settings/tasks-search.ts
  • src/renderer/src/components/sidebar/folder-workspace-composer-submit.ts
  • src/renderer/src/hooks/useComposerState.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/lib/github-work-item-background-request.ts
  • src/renderer/src/lib/launch-work-item-direct-draft.test.ts
  • src/renderer/src/lib/launch-work-item-direct-draft.ts
  • src/renderer/src/lib/launch-work-item-direct.ts
  • src/renderer/src/lib/linked-work-item-context.test.ts
  • src/renderer/src/lib/linked-work-item-context.ts
  • src/shared/constants.test.ts
  • src/shared/constants.ts
  • src/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]>
@octawizard
octawizard force-pushed the feat/linear-launch-prompt-template branch from 73fb9e2 to 227b8f7 Compare July 23, 2026 11:01
@joel-uvicuo

Copy link
Copy Markdown

Amazing! 🙌

fabolivark added a commit to ab2webco/orca-oss that referenced this pull request Jul 24, 2026
…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.
@nwparker nwparker added the enhancement New feature or request label Jul 27, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants