Added
- Shell hook drop-in install — Users with
.d/-style dotfiles (chezmoi, yadm, stow, oh-my-zshcustom/) now get hook fragments installed as numbered drop-in files (e.g.~/.zshenv.d/00-lean-ctx.zsh) instead of inline fenced blocks. Detection is automatic (Style::Auto); override with--style=inlineor--style=dropin. Transparent migration between styles preserves hand-edits via timestamped backups (.lean-ctx-<UTC>.bak). (#196) - Output policy classification — New
OutputPolicyenum (Passthrough,Verbatim,Compressible) provides centralized command classification for the compression pipeline. Commands likegh api,az login,docker ps,kubectl get podsare now correctly classified and never compressed.
Fixed
- Dashboard: 7 frontend data mismatch bugs — Complete attribute-by-attribute audit of all 17 dashboard pages revealed field name mismatches between frontend components and backend API responses:
cockpit-overview.js— SLO compliance now calculated fromslo.snapshot.slosarray; Verification card usesverif.total/verif.pass;streak_days === 0no longer hidden by falsy checkcockpit-health.js— SLOs render from.slos(not.results); Anomalies handle direct array response; Verification uses correcttotal/pass/warn_runsfields; Bug Memory (Gotchas) usestrigger/resolution/occurrences/first_seenand handles enumseverity/categorycockpit-agents.js— Swimlanes use actual API fields (id,role,status,status_message,last_active_minutes_ago,pid) instead of expected-but-absentname/model/tool_callscockpit-memory.js— Episodes useactions.lengthfor tool count,tokens_usedfor token display, and parse taggedOutcomeenum correctlycockpit-live.js—tokens_saved === 0no longer hidden by falsy check inbuildToolDetailcockpit-compression.js— Removed unsupporteddiffmode from UIcockpit-graph.js— Tooltip dynamically shows "B", "tok", or "lines" based on available size metric
- Token Pressure accuracy — Context field
temperaturenow usespressure.utilization(weighted decay) instead of rawtotal_tokens_sent / window_size, andbudget_remainingusespressure.remaining_tokensfor consistency with the Token Pressure card - Truncation bug causing increased token usage — Removed aggressive 8000-byte fallback truncation in
patterns::compress_outputthat produced[… N lines omitted …]markers, causing AI models to retry commands. Large outputs now flow through the safety-awarecompress_if_beneficialpipeline instead. Fixes #199. - Dashboard format utilities —
pc()NaN guard for percentage formatting;fu()type guard for unit formatting;fmtNumnormalized to consistent 'K' suffix - Dashboard route visibility — All dashboard route handlers narrowed from
pub fntopub(super) fn - Clippy
duration_suboptimal_units—Duration::from_millis(30_000)→Duration::from_secs(30)in 4 locations - Shell hook:
lsandfindmissing from alias list — Both commands are now included asCategory::DirListin the generated shell hook, solsandfindoutput is tracked/compressed in hooked shells. Fixes #200. - Shell hook: non-interactive agent commands not tracked — The TTY guard (
[ ! -t 1 ]) now has an agent-aware bypass: whenLEAN_CTX_AGENT,CODEX_CLI_SESSION,CLAUDECODE, orGEMINI_SESSIONenv vars are present, commands are tracked even in non-interactive shells (Docker, Codexbash -c). Fixes #200. - Flaky SSE replay test — Rewrote
events_endpoint_replays_tool_call_eventto append directly to the event bus instead of depending on a fire-and-forgetspawn_blockingtask, eliminating CI timing failures on contended runners.
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.5.19...v3.5.19