Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ export abstract class AICommandExecutor<TParams = any> {
*/
protected async initializeWorkspaceThread(): Promise<void> {
try {
if (!this.config.chatStorage) {
console.log('[AICommandExecutor] Chat storage not configured, skipping initialization');
return;
}
const { workspaceId, threadId } = this.config.chatStorage;

// Initialize workspace and thread
Expand Down Expand Up @@ -284,6 +288,9 @@ export abstract class AICommandExecutor<TParams = any> {
* @returns Array of chat messages, or empty array if storage disabled
*/
protected getChatHistory(): any[] {
if (!this.config.chatStorage) {
return [];
}
const { workspaceId, threadId } = this.config.chatStorage;
return chatStateStorage.getChatHistoryForLLM(workspaceId, threadId);
}
Expand All @@ -294,6 +301,9 @@ export abstract class AICommandExecutor<TParams = any> {
* @param metadata - Generation metadata (operation type, etc.)
*/
protected addGeneration(userPrompt: string, metadata: any): any {
if (!this.config.chatStorage) {
return null;
}
const { workspaceId, threadId } = this.config.chatStorage;
return chatStateStorage.addGeneration(
workspaceId,
Expand Down
Loading