Skip to content

feat(tasks): customize workspace prompts globally and per project - #34441

Open
zjffdu wants to merge 18 commits into
stablyai:mainfrom
zjffdu:task-prompt-templates
Open

zjffdu wants to merge 18 commits into
stablyai:mainfrom
zjffdu:task-prompt-templates

Conversation

@zjffdu

@zjffdu zjffdu commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Starting a workspace from a ticket can prefill your own instructions, such as {{url}} /ticket-engineer. Set a default in Task Sources and override it for a project. The text remains an unsent draft.

What changed

  • Add global and project task-start prompt templates for Jira, Linear, GitHub, and GitLab launches across desktop and mobile. Blank project values inherit the global template; blank global values preserve the provider default. Explicit one-off launch text keeps priority.
  • Persist and validate both settings, retain project overrides through identity changes, and share configuration ownership across host setups.
  • Surface save failures and serialize overlapping saves so an older response cannot undo a reset.
  • Resolve template ownership from the current project's setups. An unrelated repository with the same ID on another host can no longer redirect a project's save or refresh. Repository lookup remains the fallback when the project has no setups.

Fixes #16066. Related: #9066.

Verification

The duplicate-repository-ID regression failed before the fix for local, SSH, and runtime hosts. All three cases pass after the fix.

Rebased onto upstream main 1c30348d65. Project prompt updates now use the upstream-owned IPC schema in project-group-ipc-arg-schemas.ts; the repo IPC module keeps its re-export. The field remains inside the new lazy IPC/RPC/catalog schemas, including nullable project resets. Upstream chat-history deletion behavior, the current repository MCP settings component, runtime status readers, and mobile warning behavior are preserved.

Updated the persistence regression to supply the repository index required by the current merge function. Consolidated imports from the existing pairing-address module to satisfy the existing file-size limit without changing runtime logic. No gates or thresholds were changed.

On head 08baf41c1c, ORCA_BACKGROUND_LAUNCH=1 ORCA_CODE_QUALITY_BASE=1c30348d65 timeout 900 pnpm check:changed --base=1c30348d65 --maxWorkers=2 passed all 47 selected checks in 59.3 seconds, including unit tests, selected TypeScript projects, lint, formatting, changed-code quality, localization, and the E2E tests-only typecheck ratchet. A direct assertion script also verified that the actual IPC/RPC schemas preserve template text and nullable resets, the global schema preserves empty-string resets, and invalid template types are rejected.

The Electron journey, raw E2E typecheck, and real-device/remote acceptance were not rerun for this head. The selected gate result does not claim hosted CI or runtime UI acceptance.

Earlier validation included hidden Electron journeys covering settings saves, workspace creation, restart persistence, and reset to global inheritance. Those journeys were not repeated for this fix. Earlier read-only acceptance with a real Jira ticket and GitHub Copilot CLI verified skill expansion and a source-backed plan; no plan was executed and no identifying data is included here.

The pushed head is 08baf41c1c4166578876a08063e3a0a601162ab5. GitHub confirms the PR is mergeable. The following Actions workflows require repository-side approval: PR test LoC, Docs site, PR description, PR Checks, Headless Node server, Mobile Checks, Mobile Native Fingerprint. The cleanup check passed and CodeRabbit was skipped. No merge was performed.

Visual proof and remaining checks

Settings fixtures and a synthetic Jira draft were inspected locally during earlier validation. Public before/after attachments remain pending. Packaged builds, Linux, Windows, real mobile devices, and live SSH acceptance have not been verified for this head.

Notes

Templates substitute only the stable task URL; ticket descriptions and comments are not inserted into the instructions. Mobile uses the paired project catalog. Older catalog payloads retain global/default behavior.

AI disclosure

OpenAI Codex assisted with implementation, review, and verification. GitHub Copilot CLI was used for the earlier read-only live acceptance check.

Checklist

  • User-facing behavior and mechanism explained.
  • Regression tests added and focused checks passed.
  • Cross-platform, remote, mobile, and folder-workspace impact considered.
  • No upstream skill-installer source or artifacts copied or mechanically translated.
  • Public before/after screenshots or videos attached.
  • Upstream conflicts resolved.
  • Full CI and packaged/platform validation complete.

@zjffdu
zjffdu force-pushed the task-prompt-templates branch 2 times, most recently from 0c0e116 to 4a3c636 Compare October 28, 2026 06:38
@zjffdu
zjffdu marked this pull request as ready for review October 28, 2026 07:08
@zjffdu
zjffdu requested a review from brennanb2025 as a code owner October 28, 2026 07:08
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review
Walkthrough

Adds global and project-level linked-work-item prompt templates. The settings are normalized and persisted, and project updates account for host ownership. Desktop and mobile workspace creation resolve a template and use it to prepare a draft with the work-item URL. Settings controls support editing, saving, reset, and project inheritance.

Merge Risk: Minimal · up to d881e

No actionable risk introduced by this change remains established. The unlinked-note behavior is unchanged; normal checks are still appropriate before merging.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description follows the template well. It has an ELI5, a What changed section, a Why-style rationale covering the duplicate-repository-ID fix, a linked issue (Fixes #16066), a Verification section… Add a Performance line that completes the sentence, for example 'None, because the template is read only at launch and at settings save.' Set the Risk level to Low, Medium, or High and describe how to back out the change (a revert, and whet…
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: customizable task prompts at global and project scope.
Linked Issues check Passed Issue #16066 requests a configurable, provider-agnostic template for ticket-linked workspace prompts and identifies {identifier}, {url}, and {title} as example placeholders. The implementation p…
Out of Scope Changes check Passed The changes remain within issue #16066. Settings UI, persistence, project and host ownership, mobile contracts, launch wiring, documentation, fixtures, and regression tests support configurable linked…
Full details: Linked Issues check

Explanation

Issue #16066 requests a configurable, provider-agnostic template for ticket-linked workspace prompts and identifies {identifier}, {url}, and {title} as example placeholders. The implementation provides a shared {{url}} template mechanism for Jira, Linear, GitHub, and GitLab. It applies the template across direct, composer, folder, and mobile launches. It preserves explicit prompts, keeps ticket prose out of drafts, persists global and project values, and includes regression coverage. Per-provider, per-launch, and workflow-state selection are described as optional or ideal extensions. The narrower URL-only placeholder set is stated in the PR scope and does not prevent the requested core behavior.

Full details: Out of Scope Changes check

Explanation

The changes remain within issue #16066. Settings UI, persistence, project and host ownership, mobile contracts, launch wiring, documentation, fixtures, and regression tests support configurable linked-work-item prompt templates. Compatibility and typed-only Linear changes preserve template ownership and existing launch behavior. No unrelated product area or dependency change is established.

Full details: Description check

Explanation

The description follows the template well. It has an ELI5, a What changed section, a Why-style rationale covering the duplicate-repository-ID fix, a linked issue (Fixes #16066), a Verification section with test results, a Performance statement, a Risk discussion, an AI disclosure, and a checklist. It has gaps: the Performance section is missing the required 'None, because' justification, the Risk section lacks a Level (Low/Medium/High), the Visual Proof section has unchecked public before/after attachments and no before/after media or 'N/A' reason, and the Review section and Agent skill upstream boundary checkbox are not addressed in the template form. The 'Why' section is not explicit about why this approach beats the alternatives.

Resolution

Add a Performance line that completes the sentence, for example 'None, because the template is read only at launch and at settings save.' Set the Risk level to Low, Medium, or High and describe how to back out the change (a revert, and whether saved settings persist). Add before and after visual proof for the settings UI and the Jira draft, or write N/A with a reason. Add a Why section that explains the chosen approach and the alternatives considered. Tick or address the agent skill upstream boundary item and the Review section.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@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.


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3ebcb178-96bd-4fcf-9d0c-0b806030b898
Commits

Reviewing files that changed from the base of the PR and between 55f8a8d and 4a3c636.

Files selected for processing: 62
  • docs/site/content/docs/settings.mdx
  • mobile/src/components/new-worktree-agent-selection.ts
  • mobile/src/components/use-new-workspace-create-submit.ts
  • mobile/src/tasks/linked-work-item-prompt-template.test.ts
  • mobile/src/tasks/linked-work-item-prompt-template.ts
  • mobile/src/tasks/mobile-tasks-view-state-types.ts
  • mobile/src/tasks/source-workspace-create.test.ts
  • mobile/src/tasks/source-workspace-create.ts
  • mobile/src/tasks/use-mobile-tasks-workspace-create-actions.tsx
  • mobile/src/tasks/workspace-create-params.test.ts
  • mobile/src/tasks/workspace-create-params.ts
  • src/main/ipc/repos/repo-ipc-arg-schemas.ts
  • src/main/persistence/applying-settings/persistence-linked-work-item-prompt.test.ts
  • src/main/persistence/applying-settings/settings-update.ts
  • src/main/persistence/loading-store/normalize-loaded-global-settings.ts
  • src/main/persistence/tracking-repos/project-host-operations.ts
  • src/main/runtime/rpc/methods/repo.test.ts
  • src/main/runtime/runtime-client-agent-launch-settings.test.ts
  • src/main/runtime/runtime-client-settings-shape.ts
  • src/main/runtime/runtime-client-settings.ts
  • src/main/runtime/runtime-store-contract.ts
  • src/renderer/src/components/settings/TaskPromptTemplateSetting.fixture.tsx
  • src/renderer/src/components/settings/TaskPromptTemplateSetting.test.tsx
  • src/renderer/src/components/settings/TaskPromptTemplateSetting.tsx
  • src/renderer/src/components/settings/TasksPane.test.tsx
  • src/renderer/src/components/settings/TasksPane.tsx
  • src/renderer/src/components/settings/repository/RepositoryPane.tsx
  • src/renderer/src/components/settings/repository/repository-search.ts
  • src/renderer/src/components/settings/settings-project-prompt-owner.test.tsx
  • src/renderer/src/components/settings/settings-project-section-renderer.tsx
  • src/renderer/src/components/settings/task-prompt-template-search.ts
  • src/renderer/src/components/settings/tasks-search.ts
  • src/renderer/src/components/sidebar/folder-workspace-agent-startup.ts
  • src/renderer/src/components/sidebar/folder-workspace-composer-submit.ts
  • src/renderer/src/components/sidebar/folder-workspace-linked-startup-plan.test.ts
  • src/renderer/src/hooks/composer-state/quick-creation-execution.test.ts
  • src/renderer/src/hooks/composer-state/quick-creation-execution.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/launch-work-item-direct-draft.ts
  • src/renderer/src/lib/launch-work-item-direct.test.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/renderer/src/store/projects/project-update.ts
  • src/renderer/src/store/slices/repos-project-runtime.spec.ts
  • src/shared/global-settings-types.ts
  • src/shared/linked-work-item-prompt-settings.ts
  • src/shared/mobile-project-sections-contract.ts
  • src/shared/project-catalog-row-normalization.test.ts
  • src/shared/project-catalog-row-normalization.ts
  • src/shared/project-compatibility-host-merge.ts
  • src/shared/project-compatibility-merge.ts
  • src/shared/project-identity-succession.test.ts
  • src/shared/project-identity-succession.ts
  • src/shared/project-prompt-template-compatibility.test.ts
  • src/shared/project-prompt-template-owner.test.ts
  • src/shared/project-prompt-template-owner.ts
  • src/shared/project-section-catalog-schema.ts
  • src/shared/project-types.ts
  • src/shared/rpc-contract/client-settings-params.ts
  • src/shared/rpc-contract/project-runtime-params.ts
  • tests/e2e/task-prompt-template.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@zjffdu
zjffdu force-pushed the task-prompt-templates branch 2 times, most recently from d8054d6 to 0fe98eb Compare November 2, 2026 14:47
@zjffdu
zjffdu force-pushed the task-prompt-templates branch from 0485ee9 to d881ea7 Compare November 3, 2026 03:28

@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.

Additional comments: 1
src/renderer/src/lib/linked-work-item-context.test.ts-107-110: 1

107-110: Major · Functional Correctness · Quick win

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Preserve the note for unlinked quick creation.

When linkedWorkItem is null, this assertion accepts an empty prompt despite the "User note" input. prepareQuickComposerStartup passes that empty prompt to agent startup; the separate note field is a worktree comment, not the agent prompt. Change the resolver to return the trimmed note for an unlinked workspace, and assert prompt: 'User note' here. (raw.githubusercontent.com)

Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2be816a6-ea79-4b14-8b80-f7b6a84bbfb2
Commits

Reviewing files that changed from the base of the PR and between 0485ee9 and d881ea7.

Files selected for processing: 4
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/launch-work-item-direct-prompt-template.test.ts
  • src/renderer/src/lib/linked-work-item-context.test.ts
  • src/renderer/src/store/slices/repos-project-prompt-template.test.ts
Files skipped from review as they are similar to previous changes: 1
  • src/renderer/src/i18n/locales/en.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@zjffdu
zjffdu force-pushed the task-prompt-templates branch 3 times, most recently from f42f492 to 1cae6b2 Compare November 6, 2026 01:28
@zjffdu
zjffdu force-pushed the task-prompt-templates branch 2 times, most recently from 5a3783d to cd923b5 Compare November 23, 2026 06:32
@zjffdu
zjffdu force-pushed the task-prompt-templates branch from cd923b5 to 08baf41 Compare November 30, 2026 11:53

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Configurable start prompt template for ticket-linked workspaces

2 participants