v3.9.15
Added
- Panic-safe tree-sitter with per-language blocklist —
extract_signatures
now wraps tree-sitter incatch_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 getsignaturesmode
(~85% compression) instead offull(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 throughsignaturesmode, 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:catch_unwindaround tree-sitter — panics in grammars degrade
gracefully to regex signatures, never crash the session.- Per-language blocklist — panicked languages skip tree-sitter for the
rest of the session, avoiding repeated catch_unwind overhead. - Mutex poison recovery —
get_cached_sig_querynow 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-ctxNote: After upgrading via cargo/npm/brew, run
lean-ctx setupto refresh shell aliases.lean-ctx updatedoes this automatically.
Full Changelog: v3.9.15...v3.9.15