Skip to content

v0.20.2

Choose a tag to compare

@snonux snonux released this 11 Mar 16:54
· 281 commits to main since this release

Release v0.20.2

openai:gpt-4.1
────────────────────────────────────────────────────────────────────────────────────────────────────

## Overview                                                                                         
                                                                                                    
This release focuses on improving reliability, maintainability, and user experience in configuration
 handling and code completion within Hexai. It introduces a more robust approach to default configur
ation path resolution, enhances the internal structure for code completion state management, and ref
actors LLM (Large Language Model) client handling for better extensibility and testability. Several 
minor bug fixes and test improvements are also included.                                            
                                                                                                    
---                                                                                                 
                                                                                                    
## Improvements                                                                                     
                                                                                                    
### Robust Default Configuration Path Handling                                                      
                                                                                                    
- **Consistent Default Config Path**: All CLI tools (`hexai`, `hexai-lsp-server`, `hexai-tmux-action
`, `hexai-tmux-edit`) now use a unified, robust method to determine the default configuration file p
ath. If the config path cannot be resolved (e.g., due to environment issues), the tools now display 
the documented XDG fallback path (`$XDG_CONFIG_HOME/hexai/config.toml`) instead of failing or showin
g inconsistent results.                                                                             
    - **Why this matters**: Users will always see a clear, predictable default config path in help m
essages and error outputs, reducing confusion and setup friction.                                   
                                                                                                    
- **Graceful Log Path Fallback**: The LSP server now falls back to the system temp directory for log
 files if the state directory cannot be created, instead of panicking.                              
    - **Why this matters**: Prevents crashes in restricted or unusual environments, improving robust
ness.                                                                                               
                                                                                                    
### Code Completion State Refactoring                                                               
                                                                                                    
- **Dedicated Completion State Module**: The code completion cache and related state (such as pendin
g completions and throttle timing) have been refactored into a dedicated, thread-safe module.       
    - **Why this matters**: This makes the codebase easier to maintain, improves concurrency safety,
 and lays the groundwork for future enhancements to completion features.                            
                                                                                                    
- **Improved LRU Cache for Completions**: The internal cache for recent completions is now more reli
able and easier to test, ensuring that repeated completion requests are handled efficiently.        
                                                                                                    
### LLM Client Registry Refactor                                                                    
                                                                                                    
- **Centralized LLM Client Management**: The logic for managing multiple LLM providers (e.g., OpenAI
, Anthropic) is now encapsulated in a registry, supporting efficient caching and reuse of clients.  
    - **Why this matters**: This makes it easier to add new providers or customize provider selectio
n per request, and improves performance by avoiding unnecessary client re-creation.                 
                                                                                                    
- **Better Error Handling**: If an alternate LLM provider cannot be initialized, the system now grac
efully falls back to the default provider, ensuring continued operation.                            
                                                                                                    
### Testing and Reliability                                                                         
                                                                                                    
- **Expanded Unit Tests**: New tests cover config path resolution, log path fallback, and LLM client
 registry behavior, increasing confidence in these critical areas.                                  
- **Bug Fixes**: Minor bugs in test server setup and file ignore logic were addressed, further impro
ving reliability.                                                                                   
                                                                                                    
---                                                                                                 
                                                                                                    
## Developer Experience                                                                             
                                                                                                    
- **Cleaner Codebase**: Several large and complex functions were split into smaller, focused helpers
, making the code easier to understand and maintain.                                                
- **Improved Testability**: The new modular structure for completion state and LLM client management
 allows for more thorough and isolated testing.                                                     
                                                                                                    
---                                                                                                 
                                                                                                    
## Migration and Breaking Changes                                                                   
                                                                                                    
- **No breaking changes** are introduced in this release. All changes are backward compatible. Howev
er, if you have custom scripts or integrations that depend on the internal structure of the LSP serv
er or CLI tools, you may wish to review the new config path logic for consistency.                  
                                                                                                    
---                                                                                                 
                                                                                                    
## Summary                                                                                          
                                                                                                    
This release makes Hexai more robust in diverse environments, easier to configure, and more maintain
able for future development. Users benefit from clearer error messages, more reliable completions, a
nd improved stability across all tools.