Skip to content

Commit 76cb076

Browse files
fix: gracefully handle ProjectManager database init failures
- Wrap ProjectManager.getInstance() in try-catch - Prevents crash on native module version mismatch
1 parent 3b92bc4 commit 76cb076

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

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.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@stackmemoryai/stackmemory",
3-
"version": "0.5.46",
3+
"version": "0.5.47",
44
"description": "Lossless memory runtime for AI coding tools - organizes context as a call stack instead of linear chat logs, with team collaboration and infinite retention",
55
"engines": {
66
"node": ">=20.0.0",

src/cli/index.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -717,10 +717,14 @@ program
717717

718718
// Auto-detect current project on startup
719719
if (process.argv.length > 2) {
720-
const manager = ProjectManager.getInstance();
721-
manager.detectProject().catch(() => {
722-
// Silently fail if not in a project directory
723-
});
720+
try {
721+
const manager = ProjectManager.getInstance();
722+
manager.detectProject().catch(() => {
723+
// Silently fail if not in a project directory
724+
});
725+
} catch {
726+
// Silently fail if database initialization fails (e.g., native module version mismatch)
727+
}
724728
}
725729

726730
// Only parse when running as main module (not when imported for testing)

0 commit comments

Comments
 (0)