Repository navigation
Exit with distinct statuses for not found, auth and unavailable - #295
Merged
Merged
Conversation
Every runtime failure exited 1, so a script could not tell a revoked key from a missing issue without parsing stderr. Failures now carry a class on the error itself, set where the evidence is structured (request classification, credential selection, entity lookups) and kept through context: 3 not found, 4 authentication, 5 unavailable (network, timeout, HTTP 408/429/5xx, Linear's RATELIMITED code, which comes with HTTP 400), 1 for everything else, alongside the existing 2 and 130. The report suggested 3 auth / 4 not found / 5 network. Two independent designs both chose 4 for authentication to match `gh`, and broadened "network" to "unavailable" since the question a script asks is whether retrying later can help. Beyond the literal report: a missing entity next to an authentication error is no longer treated as "not found" (each GraphQL error is classified and the most serious wins, and the not-found check now only matches Linear's own wording); `linear api` classifies its response the same way, and its local input errors are usage errors; bulk commands exit with the most serious class among their items (4 > 5 > 1 > 3) and only say "could not be found" when every skipped item was missing. The statuses are listed in `linear --help`, the README, the usage docs and the agent skill. Github-Issue: Fixes #293 Github-Issue-Url: #293
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.
Every runtime failure exited 1, so a script couldn't tell a revoked key from a missing issue without parsing stderr. Failures now carry a class on the error, set where the evidence is structured (request classification, credential selection, entity lookups) and kept through
.context():AUTHENTICATION_ERROR)RATELIMITED(which comes with HTTP 400)The issue's table, re-run against real Linear with this build:
linear api '{ viewer { name } }'linear issue view …linear api '{ issue(id: "ZZZ-99999") { id } }'linear api '{ nope }'How this differs from the suggestion in the issue:
gh(4 = authentication required), which agents already know.Entity not found…/Could not find referenced…).linear apiclassifies its response the same way, and its local input mistakes (no query, bad--variables-json) are now usage errors (2).Documented in
linear --help, the README,docs/usage.md, the agent skill, and the CHANGELOG's "Upgrading from 2.x" exit-codes entry.Fixes #293