v1.6.2 - Code Quality Improvements
v1.6.2 - Code Quality Improvements
This hotfix release includes comprehensive code quality improvements from a systematic QA review:
Code Quality Enhancements
- Eliminated ~380 lines of duplicate code through systematic refactoring
- Created 12 focused helper methods improving code organization and maintainability
- Fixed silent exception handling with proper error logging
- Improved type safety with additional type hints
- Added named constants replacing magic numbers (TOKEN_TO_WORD_RATIO, SECURE_FILE_PERMISSIONS)
- Moved lazy imports to module level for better performance
Refactored Methods
restore_session(): Reduced from 186 to 80 lines_handle_compact_command(): Reduced from 149 to 111 lines_extract_token_usage(): Reduced from 104 to 35 lines
Testing
- All 318 tests passing
- Clean linting (ruff)
- Clean type checking (mypy)
This release maintains full backward compatibility while significantly improving code maintainability and debuggability.