v3.5.4
Fixed
ghCLI compression safety — Unknownghsubcommands (gh pr diff,gh api,gh search,gh workflow,gh auth,gh secret, etc.) now pass through verbatim instead of being truncated to 10 lines. Previously, fallback compressors (JSON, log-dedup) could also strip content fromgh apiandgh searchoutput. The fix returnsSome(output)for unmatched commands (blocking fallback compression), matching the safe behavior already used bygitandglabpatterns.- Uninstall proxy cleanup —
lean-ctx uninstallnow cleans up Claude Code (ANTHROPIC_BASE_URLinsettings.json) and Codex CLI (OPENAI_BASE_URLinconfig.toml) proxy settings. Previously only shell exports (Gemini) were removed, leaving Claude/Codex pointing at the dead local proxy after uninstall. If a saved upstream exists, Claude Code settings are restored to the original URL. - CLI
ls/grepdaemon path resolution —lean-ctx ls .andlean-ctx grep <pattern> .now resolve relative paths to absolute before sending to the daemon, fixing incorrect directory listings when the daemon's CWD differs from the CLI's CWD.
Added
- Context Bus v2: Multi-Agent Coordination — Major upgrade to the event bus with versioned events, causal lineage, consistency levels, and multi-agent conflict detection.
- Event versioning: Every event now carries a monotonic
versionper (workspace, channel) and an optionalparentIdfor causal chains. - Consistency levels: Events classified as
local(informational),eventual(shared, async), orstrong(requires sync) — enables agents to prioritize reactions. - K-bounded staleness guard: When a shared-mode agent falls behind by >10 events, tool responses include a
[CONTEXT STALE]warning. - Knowledge conflict detection: Concurrent writes to the same knowledge key by different agents inject
[CONFLICT]warnings before proceeding. - Enriched payloads: Event payloads now include
path,category,key, andreasoning(from active session task) for richer observability. - SSE backfill on lag: When a broadcast subscriber falls behind, missed events are automatically backfilled from SQLite instead of dropped.
- New REST endpoints:
GET /v1/context/summary(materialized workspace view),GET /v1/events/search(FTS5 full-text search),GET /v1/events/lineage(causal chain traversal). - Team Server scopes expanded:
ctx_session,ctx_knowledge,ctx_artifacts,ctx_proof,ctx_verifymapped tosessionMutations,knowledge,artifacts,searchscopes. - Session race fix:
SharedSessionStore::get_or_loaduses atomicentryAPI to prevent TOCTOU races under concurrent agent loads.
- Event versioning: Every event now carries a monotonic
- Configurable proxy upstreams — Teams routing through custom API gateways can now set
proxy.anthropic_upstream,proxy.openai_upstream, andproxy.gemini_upstreamvialean-ctx config setor environment variables. Upstreams are resolved once at proxy startup (env > config > default). - Proxy upstream diagnostics —
lean-ctx doctorvalidates proxy upstream URLs (self-referential loop detection, URL format) and reports which upstreams are active. - 6 new adversarial compression tests —
gh pr diff,gh api,gh search,gh workflowverbatim passthrough, plus shell-hook-level diff preservation test.
Changed
- Dry-run uninstall —
lean-ctx uninstall --dry-runnow previews Claude Code and Codex proxy cleanup actions.
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.4...v3.5.4