Skip to content

Restore Linear agent-skill setup prompt and add provider-card install CTA#7990

Merged
brennanb2025 merged 1 commit into
mainfrom
brennanb2025/restore-linear-skill-prompt
Jul 10, 2026
Merged

Restore Linear agent-skill setup prompt and add provider-card install CTA#7990
brennanb2025 merged 1 commit into
mainfrom
brennanb2025/restore-linear-skill-prompt

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Background

PR #5071 (36277801e, "Make remote hosts first class") accidentally removed the LinearAgentSkillSetupPrompt modal from WorktreeCard.tsx while reworking imports and cache keys. The component has been orphaned since — it exists and is tested, but nothing in production renders it, so users linking a Linear issue to a worktree never get prompted to set up the orca-linear agent skill.

Linear integration in Orca is two decoupled setups that are easy to conflate:

  1. Task provider (Settings → task trackers): an API key that lets Orca browse and link Linear issues.
  2. Agent skill (orca-linear, legacy linear-tickets): a globally installed skill that lets agents read and edit the linked tickets.

Completing (1) gave no hint that (2) exists. This PR restores the regressed prompt and bridges the two surfaces.

Changes

Restore the setup modal in WorktreeCard.tsx (regression fix)

Re-adds the exact pre-#5071 wiring: on the active worktree with a linked Linear issue, render LinearAgentSkillSetupPrompt with linked, surface="modal", settings, and remote derived from repo?.connectionId || settings?.activeRuntimeEnvironmentId (SSH-connected repos and remote runtime environments count as remote). All referenced identifiers are unchanged in the current component, and the block sits in its original spot before the inline agent list. The modal path behaves as before: the prompt scans CLI + installed skills, and the reminder toast / setup dialog only surface when setup is actually missing.

Install CTA on the Linear provider card (task-tracker-integration-cards.tsx)

New LinearAgentSkillInstallCta (own file, keeps the card under the max-lines budget) rendered inside the Linear card details:

  • Detects install state via useInstalledAgentSkillNames(LINEAR_AGENT_SKILL_NAMES, …), so the legacy linear-tickets skill still satisfies the requirement.
  • Not installed: "Agent skill: orca-linear — Not installed", a one-line explanation, and a copyable ORCA_LINEAR_SKILL_INSTALL_COMMAND block (constants from src/shared/agent-feature-install-commands.ts, nothing hardcoded).
  • Installed: subtle "Installed" pill plus the copyable update command.
  • Mirrors the sidebar prompt's runtime resolution (linear-agent-skill-runtime.ts), so on Windows/WSL the scan targets the agent runtime and the command is wsl.exe-wrapped, and with a remote runtime environment active it reuses the existing "remote agent environments may need separate setup" copy.
  • Presentation reuses the integration-card row helpers (useIntegrationCommandRowClass/useIntegrationSubordinateRowClass), IntegrationStatusPill, and the same copy-button interaction as AgentSkillSetupPanel — design tokens only, no new colors/sizes.

Shared update-command selection

The legacy-aware update-command choice (legacy-only installs update linear-tickets; everything else moves through canonical orca-linear) moved from the prompt into src/renderer/src/lib/linear-agent-skill-update-command.ts so both surfaces share it. The agent-skill-installed-command-callers guard fixture is updated to track the helper.

Verification

  • pnpm typecheck passes (node + cli + web).
  • oxlint clean on touched files; pnpm check:max-lines-ratchet passes (no new suppressions; CTA extracted to its own file).
  • Localization catalog synced for the new keys; verify:localization-catalog and verify:localization-coverage pass.
  • Tests: LinearAgentSkillSetupPrompt.test.tsx + .update-command (30), all 18 WorktreeCard* files (173), task-tracker-integration-cards.test.tsx, new linear-agent-skill-install-cta.test.tsx (6: both states, legacy update command, clipboard copy, remote note, re-check), plus the 7 adjacent suites touching useInstalledAgentSkills/CliSkillRuntimeSetup/AgentSkillSetupPanel — all pass.

Pre-existing failures on a clean checkout, unrelated to this change: LinearAgentSkillSetupPrompt.reminder-toast.test.tsx (window.localStorage undefined in the test env) and the lint:switch-exhaustiveness error in src/main/ipc/notification-authorization-status.ts.

Tests

Live end-to-end validation in the running Electron app (this PR worktree, identity verified via window.api.app.getIdentity(), isolated dev userData, demo-project as target). The orca-linear skill was genuinely absent at start and genuinely installed mid-test.

  • Restored modal — missing state: created a demo-project worktree linked to a Linear issue via the production createWorktree path; on first activation the setup dialog auto-opened: "Enable Linear ticket access" / "Orca CLI and Linear agent skill are missing." / Install CLI & Skill / Re-check / Don't show again / Not now.
  • Provider-card CTA — not-installed detection: Settings → Integrations → Linear (provider genuinely connected) showed "Agent skill: orca-linear — Not installed", "Let your agents read and edit Linear tasks.", and the install command row.
  • Copy button: clicking Copy command put exactly npx skills add https://github.com/stablyai/orca --skill orca-linear --global on the system clipboard (verified via pbpaste).
  • Real install: ran the copied command; ~/.agents/skills/orca-linear/SKILL.md created, npx skills ls --global lists it (one non-fatal per-agent failure: PromptScript doesn't support global installs).
  • Installed detection (CTA): clicking Re-check flipped the pill to "Installed" with "Agent skill installed. To update it, run:" and npx skills update orca-linear --global (copy button verified too).
  • Installed detection (modal): after reload + reactivation the modal auto-opened showing only "Orca CLI is missing." with the action button now "Update" — the skill half of the scan detects the fresh install.
  • Unit/static: full pnpm typecheck, oxlint on touched files, max-lines ratchet, localization checks; prompt suites, 18 WorktreeCard* files (173 tests), card + 6 new CTA tests, callers guard — all pass.
  • Zero renderer console errors during all flows; all test state cleaned up (worktrees/branches/repo registration/userData removed).
  • CLI-half of the modal in a packaged app: dev builds report the Orca CLI as unsupported, so setupReady/success-modal can't be exercised in dev. Pre-existing prompt behavior, unchanged by this PR; covered by existing unit tests.
  • Remote-runtime/WSL nuances (remote hint line, wsl.exe command wrapping): presentation-only reuse of existing helpers, covered by unit tests only — no live SSH/WSL pass in this validation.

… CTA

PR #5071 (3627780) accidentally dropped the LinearAgentSkillSetupPrompt
modal from WorktreeCard, orphaning the component. Restore the exact
wiring: render on the active worktree when it has a linked Linear issue.

Also surface the decoupled orca-linear agent skill on the Linear task
provider settings card: install state via useInstalledAgentSkillNames,
copyable install/update command resolved for the agent runtime, and a
remote-setup note when a runtime environment is active. The legacy-aware
update-command selection moves into a shared lib module so the sidebar
prompt and the new CTA stay in sync.
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a Linear agent skill installation CTA with runtime-aware install or update commands, status checks, clipboard copying, refresh behavior, toast feedback, and remote/WSL setup messaging. Centralizes canonical and legacy update command selection, wires the CTA into Linear integration cards, and renders the setup prompt for active linked worktrees. Adds localized CTA strings and tests for component behavior, command selection, tooltip setup, and global API cleanup.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description is detailed, but it omits required template sections like Screenshots, AI Review Report, Security Audit, and Notes. Add the missing template sections, including a Summary, Screenshots/no visual change, AI Review Report, Security Audit, and Notes.
✅ Passed checks (3 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: restoring the setup prompt and adding the provider-card install CTA.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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 (1)
src/renderer/src/lib/linear-agent-skill-update-command.ts (1)

15-28: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add direct unit tests for getLinearAgentSkillUpdateCommand.

This function is a small pure function but centralizes business logic (canonical vs. legacy vs. fresh-install command selection) previously duplicated across two components. The only existing test (agent-skill-installed-command-callers.test.ts) checks that call sites reference the function name via source-text matching, not that the branching logic itself behaves correctly for canonical-only, legacy-only, both-installed, and not-installed permutations.

✅ Suggested test skeleton
import { describe, expect, it } from 'vitest'
import { getLinearAgentSkillUpdateCommand } from './linear-agent-skill-update-command'
import {
  ORCA_LINEAR_SKILL_UPDATE_COMMAND,
  LINEAR_TICKETS_SKILL_UPDATE_COMMAND
} from '`@/lib/agent-feature-install-commands`'

describe('getLinearAgentSkillUpdateCommand', () => {
  it('returns the canonical command when not installed', () => {
    expect(getLinearAgentSkillUpdateCommand([], false)).toBe(ORCA_LINEAR_SKILL_UPDATE_COMMAND)
  })

  it('returns the legacy command for legacy-only installs', () => {
    // build a DiscoveredSkill fixture matching only linear-tickets
    // expect(getLinearAgentSkillUpdateCommand(legacyOnlySkills, true)).toBe(
    //   LINEAR_TICKETS_SKILL_UPDATE_COMMAND
    // )
  })

  it('returns the canonical command when the canonical skill is present', () => {
    // covers canonical-only and both-installed cases
  })
})

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d22f0dd1-dce0-4764-af97-310b585c88e4

📥 Commits

Reviewing files that changed from the base of the PR and between 4ead072 and 47629aa.

📒 Files selected for processing (13)
  • src/renderer/src/components/settings/agent-skill-installed-command-callers.test.ts
  • src/renderer/src/components/settings/linear-agent-skill-install-cta.test.tsx
  • src/renderer/src/components/settings/linear-agent-skill-install-cta.tsx
  • src/renderer/src/components/settings/task-tracker-integration-cards.test.tsx
  • src/renderer/src/components/settings/task-tracker-integration-cards.tsx
  • src/renderer/src/components/sidebar/LinearAgentSkillSetupPrompt.tsx
  • src/renderer/src/components/sidebar/WorktreeCard.tsx
  • 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/linear-agent-skill-update-command.ts

Comment thread src/renderer/src/components/sidebar/WorktreeCard.tsx
@brennanb2025
brennanb2025 merged commit 5662bf4 into main Jul 10, 2026
3 checks passed
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.

1 participant