diff --git a/src/renderer/src/components/Popups/agent/AgentModal.tsx b/src/renderer/src/components/Popups/agent/AgentModal.tsx index 8d0a41e986..6536c6103e 100644 --- a/src/renderer/src/components/Popups/agent/AgentModal.tsx +++ b/src/renderer/src/components/Popups/agent/AgentModal.tsx @@ -440,9 +440,9 @@ export const AgentModal: React.FC = ({ agent, trigger, isOpen: _isOpen, o {(tool) => (
- {tool.name} + {tool.name} {tool.description ? ( - {tool.description} + {tool.description} ) : null}
diff --git a/src/renderer/src/components/Popups/agent/SessionModal.tsx b/src/renderer/src/components/Popups/agent/SessionModal.tsx index 3682b7eeb8..98906f52b1 100644 --- a/src/renderer/src/components/Popups/agent/SessionModal.tsx +++ b/src/renderer/src/components/Popups/agent/SessionModal.tsx @@ -376,9 +376,9 @@ export const SessionModal: React.FC = ({ {(tool) => (
- {tool.name} + {tool.name} {tool.description ? ( - {tool.description} + {tool.description} ) : null}
diff --git a/src/renderer/src/config/featureFlags.ts b/src/renderer/src/config/featureFlags.ts index a2e7492bd1..ed74b3223c 100644 --- a/src/renderer/src/config/featureFlags.ts +++ b/src/renderer/src/config/featureFlags.ts @@ -1,3 +1,6 @@ +import { loggerService } from '@logger' + +const logger = loggerService.withContext('Feature Flag') /** * Feature flags for controlling gradual rollout of new features * These flags can be toggled to enable/disable features without code changes @@ -33,7 +36,6 @@ export function initializeFeatureFlags(): void { // Usage: VITE_USE_UNIFIED_DB_SERVICE=true yarn dev if (import.meta.env?.VITE_USE_UNIFIED_DB_SERVICE === 'true') { featureFlags.USE_UNIFIED_DB_SERVICE = true - console.log('[FeatureFlags] USE_UNIFIED_DB_SERVICE enabled via environment variable') } // Then check localStorage for runtime overrides (higher priority) @@ -45,15 +47,12 @@ export function initializeFeatureFlags(): void { Object.keys(overrides).forEach((key) => { if (key in featureFlags) { featureFlags[key as keyof FeatureFlags] = overrides[key] - console.log(`[FeatureFlags] ${key} set to ${overrides[key]} via localStorage`) } }) } } catch (e) { - console.warn('[FeatureFlags] Failed to parse feature flags from localStorage:', e) + logger.warn('Failed to parse feature flags from localStorage:', e as Error) } - - console.log('[FeatureFlags] Current flags:', featureFlags) } /** diff --git a/src/renderer/src/pages/home/Messages/Tools/MessageAgentTools/TaskTool.tsx b/src/renderer/src/pages/home/Messages/Tools/MessageAgentTools/TaskTool.tsx index 2007a141ee..1ca31bf1d2 100644 --- a/src/renderer/src/pages/home/Messages/Tools/MessageAgentTools/TaskTool.tsx +++ b/src/renderer/src/pages/home/Messages/Tools/MessageAgentTools/TaskTool.tsx @@ -1,9 +1,8 @@ import { AccordionItem } from '@heroui/react' import { Bot } from 'lucide-react' - -import { ToolTitle } from './GenericTools' import Markdown from 'react-markdown' +import { ToolTitle } from './GenericTools' import type { TaskToolInput as TaskToolInputType, TaskToolOutput as TaskToolOutputType } from './types' export function TaskTool({ input, output }: { input: TaskToolInputType; output?: TaskToolOutputType }) { diff --git a/src/renderer/src/pages/home/Messages/Tools/MessageAgentTools/TodoWriteTool.tsx b/src/renderer/src/pages/home/Messages/Tools/MessageAgentTools/TodoWriteTool.tsx index b844de1771..4597c5f77d 100644 --- a/src/renderer/src/pages/home/Messages/Tools/MessageAgentTools/TodoWriteTool.tsx +++ b/src/renderer/src/pages/home/Messages/Tools/MessageAgentTools/TodoWriteTool.tsx @@ -1,11 +1,11 @@ -import { AccordionItem, Chip, Card, CardBody } from '@heroui/react' -import { ListTodo, CheckCircle, Clock, Circle } from 'lucide-react' +import { AccordionItem, Card, CardBody, Chip } from '@heroui/react' +import { CheckCircle, Circle, Clock, ListTodo } from 'lucide-react' import { ToolTitle } from './GenericTools' import type { + TodoItem, TodoWriteToolInput as TodoWriteToolInputType, - TodoWriteToolOutput as TodoWriteToolOutputType, - TodoItem + TodoWriteToolOutput as TodoWriteToolOutputType } from './types' import { AgentToolsType } from './types' diff --git a/src/renderer/src/pages/home/Messages/Tools/MessageAgentTools/index.tsx b/src/renderer/src/pages/home/Messages/Tools/MessageAgentTools/index.tsx index f2605a1cca..a96c7cff6a 100644 --- a/src/renderer/src/pages/home/Messages/Tools/MessageAgentTools/index.tsx +++ b/src/renderer/src/pages/home/Messages/Tools/MessageAgentTools/index.tsx @@ -14,9 +14,9 @@ import { SearchTool } from './SearchTool' import { TaskTool } from './TaskTool' import { TodoWriteTool } from './TodoWriteTool' import { AgentToolsType, ToolInput, ToolOutput } from './types' +import { WebFetchTool } from './WebFetchTool' import { WebSearchTool } from './WebSearchTool' import { WriteTool } from './WriteTool' -import { WebFetchTool } from './WebFetchTool' const logger = loggerService.withContext('MessageAgentTools') diff --git a/src/renderer/src/pages/settings/AgentSettings/AgentEssentialSettings.tsx b/src/renderer/src/pages/settings/AgentSettings/AgentEssentialSettings.tsx index 1ee1ffcb04..f6cdb5704b 100644 --- a/src/renderer/src/pages/settings/AgentSettings/AgentEssentialSettings.tsx +++ b/src/renderer/src/pages/settings/AgentSettings/AgentEssentialSettings.tsx @@ -215,8 +215,8 @@ const AgentEssentialSettings: FC = ({ agent, update {(tool) => (
- {tool.name} - {tool.description ? {tool.description} : null} + {tool.name} + {tool.description ? {tool.description} : null}
)} diff --git a/src/renderer/src/services/db/index.ts b/src/renderer/src/services/db/index.ts index 245a5b67e3..9b681dc6c6 100644 --- a/src/renderer/src/services/db/index.ts +++ b/src/renderer/src/services/db/index.ts @@ -5,14 +5,15 @@ */ // Export main service -export { DbService,dbService } from './DbService' +export { DbService, dbService } from './DbService' // Export types export type { MessageDataSource, MessageExchange } from './types' export { buildAgentSessionTopicId, extractSessionId, - isAgentSessionTopicId} from './types' + isAgentSessionTopicId +} from './types' // Export implementations (for testing or direct access if needed) export { AgentMessageDataSource } from './AgentMessageDataSource' diff --git a/src/renderer/src/types/index.ts b/src/renderer/src/types/index.ts index fc6b8da85a..1ae17b172b 100644 --- a/src/renderer/src/types/index.ts +++ b/src/renderer/src/types/index.ts @@ -205,7 +205,7 @@ export enum TopicType { export type Topic = { id: string - type: TopicType + type?: TopicType assistantId: string name: string createdAt: string diff --git a/src/renderer/src/utils/__tests__/export.test.ts b/src/renderer/src/utils/__tests__/export.test.ts index 7a04b59190..559e2e489a 100644 --- a/src/renderer/src/utils/__tests__/export.test.ts +++ b/src/renderer/src/utils/__tests__/export.test.ts @@ -75,7 +75,7 @@ vi.mock('@renderer/utils/markdown', async (importOriginal) => { }) // Import the functions to test AFTER setting up mocks -import { Topic } from '@renderer/types' +import { Topic, TopicType } from '@renderer/types' import { markdownToPlainText } from '@renderer/utils/markdown' import { copyMessageAsPlainText } from '../copy' @@ -452,7 +452,8 @@ describe('export', () => { assistantId: 'asst_test_formatted', messages: [userMsg, assistantMsg] as any, createdAt: '', - updatedAt: '' + updatedAt: '', + type: TopicType.Chat } // Mock TopicManager.getTopicMessages to return the expected messages const { TopicManager } = await import('@renderer/hooks/useTopic') @@ -552,7 +553,8 @@ describe('export', () => { assistantId: 'asst_test_multi_formatted', messages: [msg1, msg2] as any, createdAt: '', - updatedAt: '' + updatedAt: '', + type: TopicType.Chat } // Mock TopicManager.getTopicMessages to return the expected messages const { TopicManager } = await import('@renderer/hooks/useTopic') @@ -587,7 +589,8 @@ describe('export', () => { assistantId: 'asst_test', messages: [msgWithEmpty] as any, createdAt: '', - updatedAt: '' + updatedAt: '', + type: TopicType.Chat } // Mock TopicManager.getTopicMessages to return the expected messages const { TopicManager } = await import('@renderer/hooks/useTopic') @@ -608,7 +611,8 @@ describe('export', () => { assistantId: 'asst_test', messages: [msgWithSpecial] as any, createdAt: '', - updatedAt: '' + updatedAt: '', + type: TopicType.Chat } // Mock TopicManager.getTopicMessages to return the expected messages const { TopicManager } = await import('@renderer/hooks/useTopic') @@ -634,7 +638,8 @@ describe('export', () => { assistantId: 'asst_test', messages: [msg1, msg2] as any, createdAt: '', - updatedAt: '' + updatedAt: '', + type: TopicType.Chat } // Mock TopicManager.getTopicMessages to return the expected messages const { TopicManager } = await import('@renderer/hooks/useTopic') @@ -655,7 +660,8 @@ describe('export', () => { assistantId: 'asst_test', messages: [] as any, createdAt: '', - updatedAt: '' + updatedAt: '', + type: TopicType.Chat } // Mock TopicManager.getTopicMessages to return empty array const { TopicManager } = await import('@renderer/hooks/useTopic') @@ -674,7 +680,8 @@ describe('export', () => { assistantId: 'asst_test', messages: null as any, createdAt: '', - updatedAt: '' + updatedAt: '', + type: TopicType.Chat } // Mock TopicManager.getTopicMessages to return empty array for null case const { TopicManager } = await import('@renderer/hooks/useTopic')