feat(errors): add shared user cancellation error - #1986
Open
aidandaly24 wants to merge 3 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## refactor #1986 +/- ##
============================================
- Coverage 96.78% 96.78% -0.01%
============================================
Files 326 326
Lines 18061 18052 -9
============================================
- Hits 17480 17471 -9
Misses 581 581 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
aidandaly24
marked this pull request as ready for review
August 12, 2026 21:19
aidandaly24
marked this pull request as draft
August 13, 2026 00:17
aidandaly24
marked this pull request as ready for review
August 13, 2026 00:22
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.
Problem
Commander exits and user cancellations bypass the shared CLI error model. The root runnable unwraps causes and checks raw error names, while Runtime invoke defines a resource-specific interruption error and rewraps cancellation during response handling.
Solution
CommanderErrorinAgentCoreCLIError.fromError, preserving help as exit0and mapping parse failures to usage exit2SilentCLIErrorcategory so only intentionally silent errors skip generic root stderr outputUserCancellationErrorwith exit code130AbortSignal.reasonfor Runtime invoke and dataset download SIGINT handlingAbortErrorhandling unchangedVerification
bun test src/errors/errors.test.tsx src/runnable/index.test.ts src/handlers/runtime/invoke/response.test.ts src/handlers/runtime/invoke/invoke.test.tsx src/handlers/eval/dataset/dataset.test.tsx(97 pass, 0 fail)bun run typecheckbun run lint:checkbun run format:checkbun run buildgit diff --check1110 pass, 0 fail1110 pass, 0 fail1110 pass, 0 fail0, help on stdout, no stderr or error log2, one Commander error line, classified as a user error130, no stdout or stderr, structuredUserCancellationErrorlog