# 🚀 CodeBuddy Code v2.23.0 Release

**Release Date**: 2025-12-22

## ✨ New Features

- **Agent SDK Permission Control Support**: SDK now supports tool invocation permission management, allowing clients to approve or reject tool execution requests
- **Agent SDK User Q&A Support**: SDK now supports AskUserQuestion tool, enabling AI agents to ask users questions and gather feedback during execution

## 🚀 Performance Optimizations

- **Significant @ File Search Performance Boost**: Optimized file search experience in large repositories, resolving lag and crash issues caused by continuous input
  - Implements single-flight full enumeration: Only one `rg --files` runs per `@` input round, avoiding redundant scans
  - Background preloading of file lists: Uses useEffect to preload file lists during idle time, preventing first search freeze
  - Only accepting latest query results: Uses requestId mechanism to discard outdated requests, preventing result flickering and redundant calculations
  - Reduced memory allocation: Fuzzy matching directly handles string arrays, generating objects only for top results
  - Automatic cleanup on context exit: Clears scan sessions when leaving `@` context, avoiding memory overhead

## 🐛 Bug Fixes

- **Fixed First Search Freeze**: Uses useEffect background preloading; if preloading incomplete on first query, loads asynchronously without blocking UI response
- **Fixed Windows Path Matching Accuracy**: Ensures all paths are unified to POSIX style separators before processing, avoiding split failures
- **Fixed execRg Timer Leak**: Ensures timeout timers are properly cleaned up on all exit paths

---

## Upgrade Notes

This release focuses on optimizing file search performance, especially when using `@` symbol for file search in large codebases. If you frequently work with large projects, you'll notice significant improvements in search response speed and stability after upgrading.

## Technical Details

### File Search Architecture Optimization

To address large repository performance issues, this release includes a comprehensive refactoring of the file search mechanism:

1. **Single-flight Pattern**: Ensures only one `rg --files` process runs at a time, avoiding resource contention
2. **Preloading Strategy**: Preloads file lists during user idle time, improving first search response speed
3. **Request Deduplication**: Automatically discards outdated search requests via requestId mechanism, ensuring result timeliness
4. **Memory Optimization**: Reduces object creation and memory allocation, improving efficiency when handling large file volumes
5. **Resource Cleanup**: Automatically cleans up unused search sessions, preventing memory leaks
