Skip to content

v3.3.3

Choose a tag to compare

@github-actions github-actions released this 22 Apr 09:56
· 1069 commits to main since this release

Session Stability + Dashboard Clarity

Bug fixes — Session root handling (PR #138)

  • Stale session root across checkouts: Fixed issue where switching between project directories could load a session from a different workspace. New load_latest_for_project_root() scans all session files and returns the most recent session matching the target project root, using canonicalized path comparison.
  • Session normalization extracted: normalize_loaded_session() now handles empty-string cleanup and stale project root healing in a single place, called from both load_by_id() and load_latest_for_project_root().
  • Startup context detection: New detect_startup_context() derives the correct project root and shell working directory at MCP server startup, even when the IDE provides only a subdirectory path (e.g. repo/src).
  • Trusted re-rooting: resolve_path() now checks startup_project_root before allowing session re-rooting from absolute paths. Only paths matching the trusted startup root can trigger a re-root, preventing accidental session takeover by untrusted paths.
  • Helper functions: Added session_matches_project_root(), has_project_marker(), and is_agent_or_temp_dir() to session.rs for robust session matching and stale-root detection.

Improvements — Dashboard and metrics clarity

  • 0%-savings tools hidden from lean-ctx gain: Write-only tools like ctx_edit that don't compress output are no longer shown in the "Top Commands" section, preventing confusing "0% savings" entries.
  • 0%-savings tools hidden from ctx_metrics: The MCP ctx_metrics tool now filters out tools with zero token activity from the "By Tool" breakdown.

Code quality

  • Fixed all clippy warnings: resolved MutexGuard held across await points in tests, vec! macro used where array literal suffices, and Default::default() struct update with all fields specified.
  • All 1295 tests pass with zero warnings, zero clippy errors, full parallel execution.

Closed issues

  • #137 (stale session root across checkouts): Fixed by PR #138.

Upgrade

lean-ctx update                 # recommended (auto-downloads + refreshes shell hooks)
cargo install lean-ctx          # or
npm update -g lean-ctx-bin      # or
brew upgrade lean-ctx

Note: After upgrading via cargo/npm/brew, run lean-ctx setup to refresh shell aliases. lean-ctx update does this automatically.

Full Changelog: v3.3.3...v3.3.3