Skip to content

feat(linear): add MCP-compatible issue listing - #9672

Merged
brennanb2025 merged 5 commits into
mainfrom
brennanb2025/linear-list-issues
Jul 21, 2026
Merged

brennanb2025 merged 5 commits into
mainfrom
brennanb2025/linear-list-issues

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add orca linear list-issues on the existing linear.listIssues RPC name
  • support the current Linear MCP filters, 250-item limit, ordering, archive scope, and cursor pagination
  • preserve the legacy renderer list contract through schema-based routing
  • support active or explicit workspaces, all fan-out with partial errors, and SSH forwarding

Validation

  • 178 focused Linear CLI/RPC/list tests passing after live-test fixes
  • pnpm run typecheck:node
  • oxlint and bundled skill guide checks

Live Electron agent validation (2026-07-21)

  • launched this exact branch in an isolated Electron dev app with the branch-local revision-3 orca-linear skill and ran a real Codex agent against the disposable orca test workspace
  • the first run exposed two real defects: generic terminal cursor help leaked into list-issues, and human team keys were sent through Linear's UUID-only ID comparator
  • fixed both defects, added regression coverage, and reran the same agent workflow through the exact dev runtime
  • paginated with --team ORC --query 'ORCA P0 LIVE 20260721' --order-by createdAt --limit 1, finding ORC-7, ORC-6, and ORC-5 exactly once across three pages with hasMore true/true/false
  • verified the combined team + Todo + priority 1 + query filter returned only ORC-5; every response was non-partial with no workspace errors
  • all Linear operations were read-only and no Stably workspace was accessed

@coderabbitai

coderabbitai Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@brennanb2025, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 3 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: aad92b27-1fde-48ed-b8c3-36375bd18503

📥 Commits

Reviewing files that changed from the base of the PR and between 54ffad089ce09c44701dd347320062b5a6a446f6 and 0501e59.

📒 Files selected for processing (33)
  • resources/skills/current-manifest.json
  • resources/skills/snapshot-registry.json
  • skill-guides/linear-tickets.md
  • skill-guides/orca-linear.md
  • skills/linear-tickets/SKILL.md
  • skills/orca-linear/SKILL.md
  • src/cli/args.ts
  • src/cli/bundled-skill-guides.ts
  • src/cli/handlers/linear-list-issues.ts
  • src/cli/handlers/linear.test.ts
  • src/cli/handlers/linear.ts
  • src/cli/help.ts
  • src/cli/index.test.ts
  • src/cli/linear-format.test.ts
  • src/cli/linear-format.ts
  • src/cli/specs/linear.ts
  • src/main/linear/mcp-issue-list.test.ts
  • src/main/linear/mcp-issue-list.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/rpc/methods/linear-issue-list-method.ts
  • src/main/runtime/rpc/methods/linear.test.ts
  • src/main/runtime/rpc/methods/linear.ts
  • src/main/runtime/runtime-rpc.ts
  • src/main/ssh/ssh-remote-linear-list-issues.test.ts
  • src/main/ssh/ssh-remote-linear-list-issues.ts
  • src/main/ssh/ssh-remote-linear-output.ts
  • src/main/ssh/ssh-remote-linear-read-cli.ts
  • src/main/ssh/ssh-remote-linear-read-flags.ts
  • src/main/ssh/ssh-remote-linear-read-help.ts
  • src/main/ssh/ssh-remote-linear-result-guards.ts
  • src/main/ssh/ssh-remote-orca-cli.ts
  • src/shared/linear-agent-access.ts
  • src/shared/linear-mcp-issue-list.ts
📝 Walkthrough

Walkthrough

Adds MCP-compatible Linear issue listing with filtering, ordering, cursor pagination, archive inclusion, workspace handling, and per-workspace errors. The backend is exposed through runtime RPC methods while preserving legacy requests. Local and SSH CLI commands parse and validate list-issue flags, dispatch requests, format results, and report pagination or workspace warnings. Command specifications, help text, skill guides, shared types, release metadata, and tests are updated.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 covers summary and validation, but omits the required Screenshots, Testing checklist, AI Review Report, Security Audit, and Notes sections. Add the missing template sections, including screenshots/no visual change, the test checklist, AI review and security audit details, and any 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 is concise and accurately summarizes the main change: adding MCP-compatible Linear issue listing.

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.

🧹 Nitpick comments (3)
src/cli/handlers/linear.test.ts (1)

96-131: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Provide a structurally correct test fixture for list-issues.

The issueResult() fixture returns an object shaped like LinearIssueContextResult (containing an issue object), but linear.listIssues expects a LinearMcpIssueListResult (containing an issues array).

Because the test command passes --json, the CLI skips formatLinearMcpIssueList and avoids crashing on result.issues.length. Passing a structurally accurate mock is safer and prevents a potential TypeError if this test is ever modified to evaluate non-JSON output.

♻️ Proposed refactor to align the mock payload
-    queueFixtures(callMock, okFixture('req_list', issueResult()))
+    queueFixtures(callMock, okFixture('req_list', { issues: [], meta: { hasMore: false, workspaceErrors: [] } }))
src/main/linear/mcp-issue-list.ts (1)

178-184: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Prefer toLowerCase for programmatic string matching.

Using .toLowerCase() is generally safer than .toLocaleLowerCase() for checking exact programmatic keywords (like 'me'), as it avoids unexpected behavior from locale-specific mapping rules (e.g., Turkish I/ı).

♻️ Proposed refactor
 function nullableUserFilter(value: string): object {
   if (value === 'null') {
     return { null: true }
   }
-  if (value.toLocaleLowerCase() === 'me') {
+  if (value.toLowerCase() === 'me') {
     return { isMe: { eq: true } }
   }
src/main/runtime/rpc/methods/linear-issue-list-method.ts (1)

35-35: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Simplify workspaceId schema and align empty-string handling.

z.string() already covers 'all', making the explicit literal union redundant in TypeScript (it simplifies to string).

Additionally, unlike LegacyListIssues, this bypasses the custom OptionalString transformer, meaning an empty string ("") will be passed to the backend as-is instead of being mapped to undefined. If empty strings should fall back to the default/active workspace, consider using OptionalString.

♻️ Proposed refactor
-    workspaceId: z.union([z.string(), z.literal('all')]).optional()
+    workspaceId: OptionalString

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 776454fa-0f6e-4a1b-b922-24cc27874fd6

📥 Commits

Reviewing files that changed from the base of the PR and between ede57cf and 0ac89eb.

📒 Files selected for processing (24)
  • skill-guides/orca-linear.md
  • skills/orca-linear/SKILL.md
  • src/cli/args.ts
  • src/cli/bundled-skill-guides.ts
  • src/cli/handlers/linear-list-issues.ts
  • src/cli/handlers/linear.test.ts
  • src/cli/handlers/linear.ts
  • src/cli/linear-format.ts
  • src/cli/specs/linear.ts
  • src/main/linear/mcp-issue-list.test.ts
  • src/main/linear/mcp-issue-list.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/rpc/methods/linear-issue-list-method.ts
  • src/main/runtime/rpc/methods/linear.test.ts
  • src/main/runtime/rpc/methods/linear.ts
  • src/main/ssh/ssh-remote-linear-list-issues.ts
  • src/main/ssh/ssh-remote-linear-output.ts
  • src/main/ssh/ssh-remote-linear-read-cli.ts
  • src/main/ssh/ssh-remote-linear-read-flags.ts
  • src/main/ssh/ssh-remote-linear-read-help.ts
  • src/main/ssh/ssh-remote-linear-result-guards.ts
  • src/main/ssh/ssh-remote-orca-cli.ts
  • src/shared/linear-agent-access.ts
  • src/shared/linear-mcp-issue-list.ts

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/linear/mcp-issue-list.ts (1)

88-107: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

nextCursor can be paired with workspaceId: 'all', which the same function rejects on replay.

nextCursor is emitted whenever pages.length === 1, but meta.workspaceId simply echoes request.workspaceId. When workspaceId: 'all' fans out to exactly one connected/successful workspace (single-org tenants, or an "all" fanout where every other workspace failed), pages.length is 1, so a nextCursor is returned together with workspaceId: 'all'. Replaying that exact {cursor, workspaceId: 'all'} pair is exactly what the guard at Line 56 rejects with linear_invalid_workspace, making the returned cursor unusable via the same workspaceId the caller used to get it. This edge case isn't exercised by the existing fan-out test (which uses two workspaces, so pages.length === 2 there and nextCursor is correctly omitted).

Consider gating nextCursor on a concrete workspace instead of just page count, and add a regression test for the single-connected-workspace workspaceId: 'all' case.

🐛 Proposed fix
       hasMore,
-      ...(hasMore && pages.length === 1 && pages[0].nextCursor
+      // Only surface a cursor when it can be replayed as-is: 'all' fanout
+      // cursors are workspace-specific and rejected by the guard above.
+      ...(hasMore && request.workspaceId !== 'all' && pages.length === 1 && pages[0].nextCursor
         ? { nextCursor: pages[0].nextCursor }
         : {}),

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 96a8c58e-cb5f-4938-a254-fac952c09d3a

📥 Commits

Reviewing files that changed from the base of the PR and between 0ac89eb and 85a573b.

📒 Files selected for processing (12)
  • resources/skills/current-manifest.json
  • resources/skills/release-mapping.json
  • resources/skills/snapshot-registry.json
  • skill-guides/linear-tickets.md
  • skills/linear-tickets/SKILL.md
  • src/cli/bundled-skill-guides.ts
  • src/main/linear/mcp-issue-list.test.ts
  • src/main/linear/mcp-issue-list.ts
  • src/main/runtime/rpc/methods/linear-issue-list-method.ts
  • src/main/runtime/rpc/methods/linear.test.ts
  • src/main/ssh/ssh-remote-linear-list-issues.test.ts
  • src/main/ssh/ssh-remote-linear-list-issues.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/ssh/ssh-remote-linear-list-issues.ts

Comment thread resources/skills/release-mapping.json Resolved
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