From 38c859979cf73ca6c203d8f61a73902a21c5d32c Mon Sep 17 00:00:00 2001 From: Paymahn Moghadasian Date: Tue, 20 Jan 2026 10:03:25 -0600 Subject: [PATCH 1/2] fix: pass sort parameter to fetchIssuesForState The sort option was being validated in issue-list.ts but fetchIssuesForState was independently reading sort from config only, causing the --sort flag to be ignored after interactive prompts (like project selection). Co-Authored-By: Claude Opus 4.5 --- src/commands/issue/issue-list.ts | 1 + src/utils/linear.ts | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/commands/issue/issue-list.ts b/src/commands/issue/issue-list.ts index 8202885..bc3b719 100644 --- a/src/commands/issue/issue-list.ts +++ b/src/commands/issue/issue-list.ts @@ -173,6 +173,7 @@ export const listCommand = new Command() allAssignees, limit === 0 ? undefined : limit, projectId, + sort, ) spinner?.stop() const issues = result.issues?.nodes || [] diff --git a/src/utils/linear.ts b/src/utils/linear.ts index 2cd2648..acebc27 100644 --- a/src/utils/linear.ts +++ b/src/utils/linear.ts @@ -361,13 +361,10 @@ export async function fetchIssuesForState( allAssignees = false, limit?: number, projectId?: string, + sort?: "manual" | "priority", ) { - const sort = getOption("issue_sort") as "manual" | "priority" | undefined if (!sort) { - console.error( - "Sort must be provided via configuration file or LINEAR_ISSUE_SORT environment variable", - ) - Deno.exit(1) + throw new Error("sort parameter is required") } const filter: IssueFilter = { From e6a40bbecc36c7a4ed06b14bfb855fe874528f82 Mon Sep 17 00:00:00 2001 From: Paymahn Moghadasian Date: Thu, 22 Jan 2026 12:51:48 -0600 Subject: [PATCH 2/2] fix: address PR feedback - Restore config fallback in fetchIssuesForState, update error message to mention --sort parameter - Gate selectOption behind isTerminal check for non-interactive use Co-Authored-By: Claude Opus 4.5 --- src/commands/issue/issue-list.ts | 8 ++++++++ src/utils/linear.ts | 9 +++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/commands/issue/issue-list.ts b/src/commands/issue/issue-list.ts index bc3b719..fc6c311 100644 --- a/src/commands/issue/issue-list.ts +++ b/src/commands/issue/issue-list.ts @@ -155,6 +155,14 @@ export const listCommand = new Command() console.error(`No projects found matching: ${project}`) Deno.exit(1) } + if (!Deno.stdin.isTerminal()) { + console.error( + `Project "${project}" not found. Similar projects: ${ + Object.values(projectOptions).join(", ") + }`, + ) + Deno.exit(1) + } projectId = await selectOption("Project", project, projectOptions) } } diff --git a/src/utils/linear.ts b/src/utils/linear.ts index acebc27..3ac4afb 100644 --- a/src/utils/linear.ts +++ b/src/utils/linear.ts @@ -361,10 +361,15 @@ export async function fetchIssuesForState( allAssignees = false, limit?: number, projectId?: string, - sort?: "manual" | "priority", + sortParam?: "manual" | "priority", ) { + const sort = sortParam ?? + getOption("issue_sort") as "manual" | "priority" | undefined if (!sort) { - throw new Error("sort parameter is required") + console.error( + "Sort must be provided via --sort parameter, configuration file, or LINEAR_ISSUE_SORT environment variable", + ) + Deno.exit(1) } const filter: IssueFilter = {