Skip to content

An AI-powered task-management system you can drop into Cursor, Lovable, Windsurf, Roo, and others.

fix: get storage type better with tm-core (#1347)

Ralph Khreishd0342d269684
diff --git a/apps/cli/src/commands/next.command.ts b/apps/cli/src/commands/next.command.ts
index 8f47b7ff..497d2d5e 100644
--- a/apps/cli/src/commands/next.command.ts
+++ b/apps/cli/src/commands/next.command.ts
@@ -127,10 +127,8 @@ export class NextCommand extends Command {
const task = await this.tmCore.tasks.getNext(options.tag);
// Get storage type and active tag
- const storageType = this.tmCore.config.getStorageConfig().type;
- if (storageType === 'auto') {
- throw new Error('Storage type must be resolved before use');
- }
+ const storageType = this.tmCore.tasks.getStorageType();
+
const activeTag = options.tag || this.tmCore.config.getActiveTag();
return {
diff --git a/apps/cli/src/commands/set-status.command.ts b/apps/cli/src/commands/set-status.command.ts
index 15dcfd58..a62fccb5 100644
--- a/apps/cli/src/commands/set-status.command.ts
+++ b/apps/cli/src/commands/set-status.command.ts
@@ -164,10 +164,7 @@ export class SetStatusCommand extends Command {
this.lastResult = {
success: true,
updatedTasks,
- storageType: this.tmCore.config.getStorageConfig().type as Exclude<
- StorageType,
- 'auto'
- >
+ storageType: this.tmCore.tasks.getStorageType()
};
// Display results
diff --git a/apps/cli/src/commands/show.command.ts b/apps/cli/src/commands/show.command.ts
index dd469563..c3641d0c 100644
--- a/apps/cli/src/commands/show.command.ts
+++ b/apps/cli/src/commands/show.command.ts
@@ -156,7 +156,7 @@ export class ShowCommand extends Command {
const result = await this.tmCore.tasks.get(taskId);
// Get storage type
- const storageType = this.tmCore.config.getStorageConfig().type;
+ const storageType = this.tmCore.tasks.getStorageType();
return {
task: result.task,
@@ -189,13 +189,13 @@ export class ShowCommand extends Command {
}
}
- // Get storage type
- const storageType = this.tmCore.config.getStorageConfig().type;
+ // Get storage type (resolved, not config value)
+ const storageType = this.tmCore.tasks.getStorageType();
return {
tasks,
notFound,
- storageType: storageType as Exclude<StorageType, 'auto'>
+ storageType
};
}
diff --git a/apps/cli/src/commands/start.command.ts b/apps/cli/src/commands/start.command.ts
index 7558772b..27ebf873 100644
--- a/apps/cli/src/commands/start.command.ts
+++ b/apps/cli/src/commands/start.command.ts
@@ -144,10 +144,10 @@ export class StartCommand extends Command {
await this.executeChildProcess(coreResult.command);
}
- // Convert core result to CLI result with storage type
+ // Convert core result to CLI result with storage type (resolved, not config value)
const result: StartCommandResult = {
...coreResult,
- storageType: this.tmCore?.config.getStorageConfig().type
+ storageType: this.tmCore?.tasks.getStorageType()
};
// Store result for programmatic access