-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Problem
When a user aborts the commit message review during il finish (by selecting "Abort" at the prompt or editing the message to be empty), the command returns exit code 0 (success) instead of a non-zero exit code.
This makes it impossible for calling tools (like the VS Code extension) to distinguish between a successful finish and an aborted one.
Current Behavior
- User runs
il finish - User selects "Abort" at the commit message prompt (or edits message to empty)
UserAbortedCommitErroris thrown- Error is caught in
finish.ts(lines 676-686) and handled withreturn(no re-throw) - CLI wrapper sees no error → calls
process.exit(0)
Result: Exit code 0 (same as success)
Expected Behavior
When the user aborts, the command should return a non-zero exit code (e.g., 130 for user cancellation, following Unix conventions).
Affected Code
src/commands/finish.ts lines 676-686 (and similar block around line 943-954 for PR workflow):
catch (error) {
if (error instanceof UserAbortedCommitError) {
getLogger().info('Commit aborted by user')
result.operations.push({
type: 'commit',
message: 'Commit aborted by user',
success: false,
})
return // Exit workflow gracefully - NO THROW
}
throw error
}Suggested Fix
Either:
- Re-throw the error so the CLI wrapper can catch it and exit with non-zero code, OR
- Return a result object that signals abort, and have the CLI wrapper check for it
Context
This issue was discovered while fixing iloom-ai/iloom-vscode#75, where aborting finish was incorrectly closing the VS Code workspace.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status