fix: pass sort parameter to fetchIssuesForState#96
Merged
Conversation
schpet
requested changes
Jan 21, 2026
schpet
left a comment
Owner
There was a problem hiding this comment.
thanks! can you please get this up-to-date with main (rebase or merge in main) – i noted a couple things too
Comment on lines
364
to
368
| ) { | ||
| 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") | ||
| } |
Owner
There was a problem hiding this comment.
issue_sort is generally intended to be set in a repo level config file, can we keep the old behaviour here and maybe just update the message, e.g. 'Sort must be provided via --sort parameter, configuration file or LINEAR_ISSUE_SORT environment variable'
| } | ||
| projectId = await selectOption("Project", project, projectOptions) | ||
| } | ||
| } |
Owner
There was a problem hiding this comment.
can we make sure this select option is gated behind an 'isTerminal' type check so agents don't run into it?
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 <noreply@anthropic.com>
- 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 <noreply@anthropic.com>
0cb2055 to
e6a40bb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--sortflag was ignored after interactive prompts (like project selection)issue-list.tsbutfetchIssuesForStateindependently read sort from config only, causing the CLI flag to be lostTest plan
linear issue list --project <partial-name> --sort manual --team <team>and confirm project prompt, then verify sort works🤖 Generated with Claude Code