Skip to content

v1.7.0 - Internal Refactoring & Code Quality

Choose a tag to compare

@jwesleye jwesleye released this 02 Jan 15:00
· 69 commits to main since this release

What's Changed

Internal Refactoring - Code Quality Improvements

This release focuses on internal code quality with no user-facing changes. All features work exactly as before, but the codebase is now significantly cleaner and more maintainable.

Major Refactoring:

  • SessionState Component - Centralized session management

    • Replaced 8 scattered instance variables with single cohesive component
    • Single source of truth for query count, conversation history, timing, and accumulated usage
    • Cleaner delta calculation for AWS Strands cumulative token tracking
  • CommandRouter Component - Type-safe command parsing

    • Replaced 330+ lines of manual string parsing with enum-based routing
    • All commands now use CommandType enum for type safety
    • Easier to add new commands and maintain existing ones
    • Better separation of command parsing from command handling

Quality Metrics:

  • 510 tests passing (100% pass rate)
  • 100% mypy type coverage
  • Ruff linting compliant
  • chat_loop.py reduced from 3,188 to 2,948 lines (-240 lines)

Components Extracted:

  1. StreamingEventParser - Event parsing logic
  2. ResponseRenderer - Response formatting and display
  3. UsageExtractor - Token/metadata extraction
  4. CommandRouter - Command parsing and routing
  5. SessionState - Session state management

Full Changelog

See CHANGELOG.md for complete version history.