Skip to content

Commit 869643b

Browse files
mylukinclaude
andcommitted
fix(cli): ensure all commands exit gracefully
- Add missing process.exit() to tasks get command - Add missing process.exit() to detect-ai and detect-ai-save commands - Add .unref() to auto-update timers to prevent blocking process exit Fixes issue where commands would hang indefinitely instead of exiting. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 6bcb5d8 commit 869643b

File tree

7 files changed

+17
-7
lines changed

7 files changed

+17
-7
lines changed

.claude-plugin/marketplace.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
33
"name": "ralph-dev",
4-
"version": "0.4.4",
4+
"version": "0.4.5",
55
"description": "Autonomous end-to-end development system that transforms requirements into production-ready code",
66
"owner": {
77
"name": "Lukin",
88
"email": "[email protected]"
99
},
1010
"metadata": {
1111
"description": "Autonomous end-to-end development system that transforms requirements into production-ready code with zero manual intervention",
12-
"version": "0.4.4",
12+
"version": "0.4.5",
1313
"homepage": "https://github.com/mylukin/ralph-dev",
1414
"repository": "https://github.com/mylukin/ralph-dev"
1515
},
@@ -18,7 +18,7 @@
1818
"name": "ralph-dev",
1919
"source": "./",
2020
"description": "Autonomous end-to-end development system - from requirement to production-ready code with zero manual intervention",
21-
"version": "0.4.4",
21+
"version": "0.4.5",
2222
"author": {
2323
"name": "Lukin",
2424
"email": "[email protected]"

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ralph-dev",
3-
"version": "0.4.4",
3+
"version": "0.4.5",
44
"description": "Autonomous end-to-end development system - from requirement to production-ready code with zero manual intervention",
55
"author": {
66
"name": "Lukin",

cli/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ralph-dev",
3-
"version": "0.4.4",
3+
"version": "0.4.5",
44
"description": "CLI tool for Ralph-dev - efficient operations for AI agents",
55
"main": "dist/index.js",
66
"bin": {

cli/src/commands/detect-ai.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ export function registerDetectAICommand(program: Command, workspaceDir: string):
6161
console.log(chalk.bold('\n💡 Tip:'));
6262
console.log('For manual detection (template-based), use:');
6363
console.log(chalk.cyan(' ralph-dev detect'));
64+
65+
process.exit(0);
6466
});
6567

6668
// Helper command to save AI detection result
@@ -104,6 +106,8 @@ export function registerDetectAICommand(program: Command, workspaceDir: string):
104106
console.log(` • ${ev}`);
105107
});
106108
}
109+
110+
process.exit(0);
107111
} catch (error) {
108112
console.error(chalk.red('❌ Failed to parse detection result'));
109113
console.error(chalk.gray('Expected JSON string with language configuration'));

cli/src/commands/tasks.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,8 @@ export function registerTaskCommands(program: Command, workspaceDir: string): vo
304304
console.log(task.notes);
305305
}
306306
}
307+
308+
process.exit(ExitCode.SUCCESS);
307309
} catch (error) {
308310
handleError(error as any, options.json);
309311
}

cli/src/services/auto-update.service.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,12 @@ export class AutoUpdateService {
133133
}
134134

135135
// Wait for background check (with timeout)
136+
// Use .unref() to prevent timers from blocking process exit
136137
const timeout = setTimeout(() => {
138+
clearInterval(interval);
137139
resolve(notifier.update);
138140
}, 5000);
141+
timeout.unref();
139142

140143
// Check periodically for update info
141144
const interval = setInterval(() => {
@@ -145,6 +148,7 @@ export class AutoUpdateService {
145148
resolve(notifier.update);
146149
}
147150
}, 100);
151+
interval.unref();
148152
});
149153
}
150154

0 commit comments

Comments
 (0)