Fixed
- Linux proxy restart loop (11258+ restarts) — When the lean-ctx binary is replaced during runtime (e.g. upgrade), Linux marks
/proc/self/exewith(deleted)suffix.find_binary()in the systemd unit generator would write this corrupted path intoExecStart, causing systemd to pass(deleted)as a CLI argument on every restart. Now usesresolve_portable_binary()which strips the suffix. Additionally, the CLI dispatch defensively removes(deleted)from args if already present in existing units (webut report) - Windows ctx_read hangs — Session lock acquire and path canonicalization now have bounded timeouts (5s for RwLock, 2s for
canonicalize()) preventing indefinite hangs on Windows reparse points and network paths (Butetengoy report) - Manifest generator uses stale tool_defs —
gen_mcp_manifestnow reads fromToolRegistry(61 tools) instead of staticgranular_tool_defs()(56 tools), ensuring the website manifest always reflects the actual registered tool count
Changed
- Context budget auto-escalation —
pressure_downgrade()now applies more aggressive mode downgrades based onContextPressure: SuggestCompression downgradesauto→map, ForceCompression downgradesfull→mapandauto|map→signatures - Cache-stable LITM output — Dynamic session statistics (
ACTIVE SESSION v…) moved from output prefix to suffix, preserving a stable prefix for LLM prefix-caching compatibility - ToolRegistry as SSOT for list_tools —
list_toolshandler now reads tool definitions from the registry instead of statictool_defs/, eliminating schema drift between exposed schemas and handler implementations - OnceLock for project root —
find_project_root()result cached viastd::sync::OnceLock, eliminating repeatedgit rev-parsesubprocess calls - Compaction sync tail-seek —
find_latest_compaction()reads only the last 4KB ofcontext_radar.jsonlinstead of the entire file, bounding I/O for large radar logs
Removed
- Dead code cleanup: removed unused functions,
#[allow(dead_code)]attributes replaced with_prefixes or deleted across 8 files
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.6.11...v3.6.11