Conversation
# Conflicts: # packages/cli/src/index.ts
There was a problem hiding this comment.
Pull request overview
This PR improves how the CLI and core library handle Linear API/network failures by introducing richer, normalized error codes/details and threading configurable request timeouts through auth/session creation.
Changes:
- Expanded
normalizeErrorinlinear-coreto map SDK/network/timeout errors into stableLinearCoreErrorcodes with machine-readabledetails. - Added a global
--timeoutCLI option (seconds) and propagated it intoAuthManager.openSession()via abort signals. - Updated CLI entrypoint to drain stdout/stderr before exiting to reduce truncated output.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/linear-core/tests/core-error.test.ts | Adds unit tests covering new error normalization mappings (SDK errors, abort/timeout, fetch causes). |
| packages/linear-core/src/errors/core-error.ts | Implements richer error normalization and adds new LinearCoreErrorCode values. |
| packages/linear-core/src/auth/session.ts | Adds timeout/signal support to sessions and threads abort signals into token refresh + SDK client creation. |
| packages/linear-core/src/auth/oauth.ts | Threads abort signals through OAuth token exchange/refresh fetch calls. |
| packages/cli/tests/options.test.ts | Extends global options tests to cover --timeout parsing and defaulting. |
| packages/cli/src/runtime/options.ts | Adds timeoutMs to computed global options with a 30s default. |
| packages/cli/src/index.ts | Registers --timeout flag and passes timeout into openSession calls. |
| packages/cli/src/bin/linear.ts | Ensures CLI exits after draining stdout/stderr. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
491
to
497
| const openSessionForCommand = async (cmd: Command) => { | ||
| const globals = getGlobalOptions(cmd); | ||
| return authManager.openSession({ profile: globals.profile }); | ||
| return authManager.openSession({ | ||
| profile: globals.profile, | ||
| timeoutMs: globals.timeoutMs, | ||
| }); | ||
| }; |
|
🎉 This PR is included in version 1.5.0-alpha.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.5.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Adds richer Linear API error normalization so network, timeout, rate-limit, auth, and SDK errors surface stable machine-readable codes and details. Adds a global
--timeoutoption, threads request abort signals through sessions and OAuth token fetches, and makes CLI exits drain output before terminating. Includes focused tests for timeout parsing and core error normalization.Validation:
pnpm verifypassed after mergingorigin/main.