Repository navigation
feat(linear): add MCP-compatible issue listing - #9672
Conversation
|
Warning Review limit reached
Next review available in: 3 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between 54ffad089ce09c44701dd347320062b5a6a446f6 and 0501e59. 📒 Files selected for processing (33)
📝 WalkthroughWalkthroughAdds 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)
✅ Passed checks (3 passed)
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.
🧹 Nitpick comments (3)
src/cli/handlers/linear.test.ts (1)
96-131: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueProvide a structurally correct test fixture for
list-issues.The
issueResult()fixture returns an object shaped likeLinearIssueContextResult(containing anissueobject), butlinear.listIssuesexpects aLinearMcpIssueListResult(containing anissuesarray).Because the test command passes
--json, the CLI skipsformatLinearMcpIssueListand avoids crashing onresult.issues.length. Passing a structurally accurate mock is safer and prevents a potentialTypeErrorif 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 valuePrefer
toLowerCasefor 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., TurkishI/ı).♻️ 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 valueSimplify
workspaceIdschema and align empty-string handling.
z.string()already covers'all', making the explicit literal union redundant in TypeScript (it simplifies tostring).Additionally, unlike
LegacyListIssues, this bypasses the customOptionalStringtransformer, meaning an empty string ("") will be passed to the backend as-is instead of being mapped toundefined. If empty strings should fall back to the default/active workspace, consider usingOptionalString.♻️ 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
📒 Files selected for processing (24)
skill-guides/orca-linear.mdskills/orca-linear/SKILL.mdsrc/cli/args.tssrc/cli/bundled-skill-guides.tssrc/cli/handlers/linear-list-issues.tssrc/cli/handlers/linear.test.tssrc/cli/handlers/linear.tssrc/cli/linear-format.tssrc/cli/specs/linear.tssrc/main/linear/mcp-issue-list.test.tssrc/main/linear/mcp-issue-list.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/rpc/methods/linear-issue-list-method.tssrc/main/runtime/rpc/methods/linear.test.tssrc/main/runtime/rpc/methods/linear.tssrc/main/ssh/ssh-remote-linear-list-issues.tssrc/main/ssh/ssh-remote-linear-output.tssrc/main/ssh/ssh-remote-linear-read-cli.tssrc/main/ssh/ssh-remote-linear-read-flags.tssrc/main/ssh/ssh-remote-linear-read-help.tssrc/main/ssh/ssh-remote-linear-result-guards.tssrc/main/ssh/ssh-remote-orca-cli.tssrc/shared/linear-agent-access.tssrc/shared/linear-mcp-issue-list.ts
There was a problem hiding this comment.
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
nextCursorcan be paired withworkspaceId: 'all', which the same function rejects on replay.
nextCursoris emitted wheneverpages.length === 1, butmeta.workspaceIdsimply echoesrequest.workspaceId. WhenworkspaceId: 'all'fans out to exactly one connected/successful workspace (single-org tenants, or an "all" fanout where every other workspace failed),pages.lengthis 1, so anextCursoris returned together withworkspaceId: 'all'. Replaying that exact{cursor, workspaceId: 'all'}pair is exactly what the guard at Line 56 rejects withlinear_invalid_workspace, making the returned cursor unusable via the sameworkspaceIdthe caller used to get it. This edge case isn't exercised by the existing fan-out test (which uses two workspaces, sopages.length === 2there andnextCursoris correctly omitted).Consider gating
nextCursoron a concrete workspace instead of just page count, and add a regression test for the single-connected-workspaceworkspaceId: '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
📒 Files selected for processing (12)
resources/skills/current-manifest.jsonresources/skills/release-mapping.jsonresources/skills/snapshot-registry.jsonskill-guides/linear-tickets.mdskills/linear-tickets/SKILL.mdsrc/cli/bundled-skill-guides.tssrc/main/linear/mcp-issue-list.test.tssrc/main/linear/mcp-issue-list.tssrc/main/runtime/rpc/methods/linear-issue-list-method.tssrc/main/runtime/rpc/methods/linear.test.tssrc/main/ssh/ssh-remote-linear-list-issues.test.tssrc/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
54ffad0 to
0501e59
Compare
Summary
orca linear list-issueson the existinglinear.listIssuesRPC nameallfan-out with partial errors, and SSH forwardingValidation
pnpm run typecheck:nodeLive Electron agent validation (2026-07-21)
orca-linearskill and ran a real Codex agent against the disposableorca test workspacelist-issues, and human team keys were sent through Linear's UUID-only ID comparator--team ORC --query 'ORCA P0 LIVE 20260721' --order-by createdAt --limit 1, findingORC-7,ORC-6, andORC-5exactly once across three pages withhasMoretrue/true/falseORC-5; every response was non-partial with no workspace errors