github yvgude/lean-ctx v3.9.15

latest release: v3.9.16
10 hours ago

Added

  • Panic-safe tree-sitter with per-language blocklistextract_signatures
    now wraps tree-sitter in catch_unwind. If a grammar panics, the language is
    blocklisted for the session and subsequent calls use the regex fallback
    instantly. Medium code files (500–6000 tok) safely get signatures mode
    (~85% compression) instead of full (0% compression).

Fixed

  • CRITICAL: ctx_read panic on code files (.rs, .c) — the v3.9.14 auto-mode
    resolver routed all code files >500 tokens through signatures mode, which
    requires tree-sitter parsing. If tree-sitter panicked on any file, the Mutex
    in the signature query cache became poisoned, causing all subsequent
    code-file reads to fail with "lean-ctx internal error". Three fixes:
    1. catch_unwind around tree-sitter — panics in grammars degrade
      gracefully to regex signatures, never crash the session.
    2. Per-language blocklist — panicked languages skip tree-sitter for the
      rest of the session, avoiding repeated catch_unwind overhead.
    3. Mutex poison recoveryget_cached_sig_query now uses
      PoisonError::into_inner() instead of .expect().

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.9.15...v3.9.15

Don't miss a new lean-ctx release

NewReleases is sending notifications on new releases.