7 Commits
Author SHA1 Message Date
adnaan 6faf5b94e8 feat: add hasAsciiControlCharacters utility and integrate it into file path validation 2026-09-15 20:57:22 +08:00
adnaan 8837d46531 feat(tests): add comprehensive tests for streaming overlay consistency and file change handling
- Introduced tests for streaming overlay consistency to ensure proper handling of assistant messages during state changes.
- Added tests for file change buffering to isolate failed deletions and ensure proper handling of update failures.
- Enhanced indexing service tests to verify concurrent initialization and proper handling of completed-index markers.
- Implemented tests for structural index SQLite store to tolerate repeated chunk IDs without aborting the build.
- Created tests for TreeSitter chunking to prevent duplicate chunk IDs and ensure correct chunk retention.
- Added tests for vector store batch updates to handle deletion failures gracefully.
- Implemented tests for sensitive settings to prevent access to credential keys.
- Enhanced provider credential store tests to ensure non-destructive legacy OAuth migration.
- Added tests for relaunch protocol to handle parent process accessibility issues.
- Introduced tests for large preview write guard to prevent unintended file truncation.
- Enhanced performance monitor memory tests to verify heap limit detection and provider behavior.
2026-08-29 23:20:58 +08:00
adnaan f2990913c4 feat: refactor token counting and logging mechanisms
- Introduced lazy loading for the tokenizer in `tokenCounter.ts` to optimize initial load times.
- Removed the `monacoTypeService` and its related functionalities to streamline the codebase.
- Updated `LargeFileViewer` to utilize `MonacoEditor` for better performance and user experience.
- Enhanced the `Sidebar` component with lazy loading for improved rendering efficiency.
- Implemented a new file logging service with rotation capabilities to manage log files effectively.
- Added tests for the new logging service and ensured token counting tests are aligned with the new tokenizer setup.
- Cleaned up unused imports and optimized existing code for better maintainability.
2026-08-26 12:51:07 +08:00
adnaan 10d5a3aacd feat: Enhance read_file tool schema to merge path and paths, improving usability
- Updated the read_file schema to allow both path and paths to coexist without conflict, treating them as a union.
- Implemented logic to normalize input, ensuring that empty paths do not persist and that valid single or multi-file requests are processed correctly.
- Added comprehensive tests to cover various scenarios, including regression tests for previously failing cases.
- Introduced memory leak detection improvements in PerformanceMonitor, with new thresholds and conditions to avoid false positives during startup.
- Added synchronous log flushing in Logger to ensure critical logs are not lost during process exit.
- Enhanced AiAttributionService to improve commit analysis and caching of existing notes.
2026-08-25 23:54:57 +08:00
adnaan 6ab0a79458 feat(tokenization): add js-tiktoken integration for accurate token counting
- Add js-tiktoken dependency for precise token counting across different languages
- Create new tokenCounter utility module with countTokens and countContentTokens functions
- Replace estimateTokens approximation logic with accurate tiktoken-based counting
- Update CompressionManager to use new token counter utilities for better context management
- Refactor estimateMessagesTokens to leverage accurate token counting with proper overhead calculation
- Add comprehensive test coverage for token counter utility
- Update tsconfig for proper module resolution
- Improve token estimation accuracy for Chinese characters, code, and structured content
- Remove estimateTokens from public exports in favor of new utility functions
2026-01-29 20:00:06 +08:00
adnaan d60b1f47a4 refactor: standardize error handling across codebase with toAppError utility
- Replace handleError with toAppError in IPC handlers (debug, llm, lsp, mcp, resources)
- Rename logAndThrowError to logAndThrowError for consistency in LLM service
- Update error handling in LSP installer and manager modules
- Standardize error handling in security modules (fileWatcher, secureFile, secureTerminal, securityModule)
- Refactor StreamingService error handling with improved error type conversion
- Update MCP client, config loader, and manager error handling patterns
- Standardize error handling in update service and agent services
- Improve error handling in tool providers and registry
- Update terminal, workspace, and completion service error handling
- Refactor shared error handler utility with better type safety
- Update error handler tests to reflect new toAppError API
- Consolidate error handling patterns across main and renderer processes for better maintainability
2026-01-29 10:47:20 +08:00
adnaan 8c7b72a9bc refactor: improve error handling and add performance monitoring utilities
- Add centralized error handler utility in shared/utils/errorHandler.ts for consistent error processing across the application
- Add usePerformance hook for renderer-side performance monitoring and metrics collection
- Update all IPC handlers (debug, lsp, mcp, resources) to use centralized error handling instead of inline try-catch blocks
- Standardize error handling in main process services (LSP installer, MCP client/manager, security modules, update service)
- Improve error handling in renderer services (git, completion, health check, LSP, MCP, terminal manager)
- Update tool executors and providers to use consistent error handling patterns
- Add .tsbuildinfo to .gitignore to exclude TypeScript build cache files
- Add comprehensive test coverage for error handler utility
- Refactor error catching patterns from `catch (error: any)` to `catch (err)` with proper type safety
- Consolidate error handling logic to reduce code duplication across 40+ files
This refactoring improves maintainability, consistency, and provides better error tracking throughout the application.
2026-01-27 22:42:53 +08:00