Restore Linear agent-skill setup prompt and add provider-card install CTA#7990
Conversation
… 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.
📝 WalkthroughWalkthroughAdds 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)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
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 (1)
src/renderer/src/lib/linear-agent-skill-update-command.ts (1)
15-28: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd 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
📒 Files selected for processing (13)
src/renderer/src/components/settings/agent-skill-installed-command-callers.test.tssrc/renderer/src/components/settings/linear-agent-skill-install-cta.test.tsxsrc/renderer/src/components/settings/linear-agent-skill-install-cta.tsxsrc/renderer/src/components/settings/task-tracker-integration-cards.test.tsxsrc/renderer/src/components/settings/task-tracker-integration-cards.tsxsrc/renderer/src/components/sidebar/LinearAgentSkillSetupPrompt.tsxsrc/renderer/src/components/sidebar/WorktreeCard.tsxsrc/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/linear-agent-skill-update-command.ts
Background
PR #5071 (
36277801e, "Make remote hosts first class") accidentally removed theLinearAgentSkillSetupPromptmodal fromWorktreeCard.tsxwhile 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 theorca-linearagent skill.Linear integration in Orca is two decoupled setups that are easy to conflate:
orca-linear, legacylinear-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
LinearAgentSkillSetupPromptwithlinked,surface="modal",settings, andremotederived fromrepo?.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:useInstalledAgentSkillNames(LINEAR_AGENT_SKILL_NAMES, …), so the legacylinear-ticketsskill still satisfies the requirement.orca-linear— Not installed", a one-line explanation, and a copyableORCA_LINEAR_SKILL_INSTALL_COMMANDblock (constants fromsrc/shared/agent-feature-install-commands.ts, nothing hardcoded).linear-agent-skill-runtime.ts), so on Windows/WSL the scan targets the agent runtime and the command iswsl.exe-wrapped, and with a remote runtime environment active it reuses the existing "remote agent environments may need separate setup" copy.useIntegrationCommandRowClass/useIntegrationSubordinateRowClass),IntegrationStatusPill, and the same copy-button interaction asAgentSkillSetupPanel— 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 canonicalorca-linear) moved from the prompt intosrc/renderer/src/lib/linear-agent-skill-update-command.tsso both surfaces share it. Theagent-skill-installed-command-callersguard fixture is updated to track the helper.Verification
pnpm typecheckpasses (node + cli + web).oxlintclean on touched files;pnpm check:max-lines-ratchetpasses (no new suppressions; CTA extracted to its own file).verify:localization-catalogandverify:localization-coveragepass.LinearAgentSkillSetupPrompt.test.tsx+.update-command(30), all 18WorktreeCard*files (173),task-tracker-integration-cards.test.tsx, newlinear-agent-skill-install-cta.test.tsx(6: both states, legacy update command, clipboard copy, remote note, re-check), plus the 7 adjacent suites touchinguseInstalledAgentSkills/CliSkillRuntimeSetup/AgentSkillSetupPanel— all pass.Pre-existing failures on a clean checkout, unrelated to this change:
LinearAgentSkillSetupPrompt.reminder-toast.test.tsx(window.localStorageundefined in the test env) and thelint:switch-exhaustivenesserror insrc/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-projectas target). Theorca-linearskill was genuinely absent at start and genuinely installed mid-test.createWorktreepath; 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.orca-linear— Not installed", "Let your agents read and edit Linear tasks.", and the install command row.npx skills add https://github.com/stablyai/orca --skill orca-linear --globalon the system clipboard (verified viapbpaste).~/.agents/skills/orca-linear/SKILL.mdcreated,npx skills ls --globallists it (one non-fatal per-agent failure: PromptScript doesn't support global installs).npx skills update orca-linear --global(copy button verified too).pnpm typecheck, oxlint on touched files, max-lines ratchet, localization checks; prompt suites, 18WorktreeCard*files (173 tests), card + 6 new CTA tests, callers guard — all pass.unsupported, sosetupReady/success-modal can't be exercised in dev. Pre-existing prompt behavior, unchanged by this PR; covered by existing unit tests.wsl.execommand wrapping): presentation-only reuse of existing helpers, covered by unit tests only — no live SSH/WSL pass in this validation.