Session Analyzer & Upgrades (v1.8.3)
Version 1.8.3 introduces several core upgrades to improve agentic performance, transparency, diagnostic speed, and distribution security. This guide covers these upgrades, including the new Interactive Session Analyzer tool.
π Interactive Session Analyzerβ
To avoid manually querying raw SQLite tables or tracing database logs when debugging issues or analyzing agent behavior, you can use the dedicated Session Analyzer script.
The script resides at: scripts/analyze-session.ts inside the muonroi-cli codebase.
How to Runβ
Run the script from the root of your muonroi-cli checkout using Bun:
# 1. View the list of recent sessions (useful to copy session IDs)
bun run scripts/analyze-session.ts
# 2. Analyze a specific session (supports partial prefix matching)
bun run scripts/analyze-session.ts <session-id-prefix>
# 3. View full message contents and reasoning traces (no truncation)
bun run scripts/analyze-session.ts <session-id-prefix> --full-text (or -f)
# 4. Dump the complete analyzed data structure as raw JSON
bun run scripts/analyze-session.ts <session-id-prefix> --json (or -j)
What It Displaysβ
The tool parses the SQLite database at ~/.muonroi-cli/muonroi.db and renders a clean, colorized terminal dashboard showing:
- π² Session Lineage Tree: Displays parent-child relationships recursively (using Breadth-First Search) to trace rotated sessions and delegated sub-sessions.
- βΉοΈ Metadata Overview: Main session model, mode (agent/chat), status (active/completed), start/updated timestamps, active directory, and execution duration.
- π° Cost & Token Dashboard: Aggregates input tokens, output tokens, cache read tokens (with hit ratio), cache creation tokens, peak input tokens, and estimated USD cost across the entire session family tree.
- π§ Experience Engine & Anti-MΓΉ Stats: Counts EE queries, rules injected, feedback sent, and compilation failures. It also displays anti-mΓΉ counters (compactions run, tool outputs elided, rehydrations from cache/disk/EE, and unavailable states).
- π¬ Chronological Timeline Flow: Shows a step-by-step trace of the session:
- User Turns: Prompt previews, PIL classification decisions (TaskType, layers run, confidence), and injected EE rules.
- Reasoning Thoughts: Thought processes (chain-of-thought) of the assistant.
- Tool Execution Blocks: Tool name, arguments preview, success/error status, execution duration, and output size (identifying concurrent runs).
- Compaction Events: Token size before, kept sequence, and text summary.
- Council Debates: Rounds run, speakers list, convergence status, and debate summary.
- Assistant Responses: Text reply previews.
β‘ Parallel Tool Execution (Phase 1)β
To minimize latency during multi-tool execution rounds, muonroi-cli supports parallel execution of read-only tools while serializing state-changing write tools.
- SimpleMutex Serialization: A FIFO mutex wraps execution blocks of non-read-only tools (like
edit_file,write_to_file,run_command/bash, etc.) to prevent file corruption, race conditions, and system state pollution. - Concurrent Read-Only Execution: Safe read-only operations (like
read_file,grep_search,lsp_query,ee_query,setup_guide, etc.) bypass the mutex and are executed concurrently viaPromise.allwhen returned in a single assistant turn.
π TUI Update Checking & Encoding Cleanupsβ
The TUI update flow has been modernized for better stability, formatting, and unicode rendering:
- Semver Comparison Logic: The version comparator now detects if the local version is ahead of the remote release tag (e.g. running local builds or unpushed tags like
v1.8.3when remote tag isv1.8.1). It displaysπ Ahead of Latest Releaseinstead of stating it is "already up to date". - Markdown Panel Formatting: Rather than printing raw, unformatted console text dumps, the
/updateresults and command guidelines are styled as clean Markdown blocks (bold fields, lists, and code blocks) in the chat log. - Unicode Encoding Cleanup: All legacy encoding-corrupted stubs (e.g. CP1252 corrupted characters like
ΞΖβ,ΞΓΒͺ,ΞΓ β) inside the TUI status updates and heartbeat timers are replaced with standard, portable UTF-8 emojis (πchecking,β³elapsed,...ellipsis).
π¦ Secured Public NPM Distributionβ
Due to the main repository transitioning to a private repository:
- NPM Package Primacy: Global installation via the public NPM registry (
npm install -g muonroi-cli) or Bun (bun add -g muonroi-cli) is now the recommended primary installation method for external users, as it does not require private repository authorization. - Standalone Installers Fallback: The standalone curl/irm scripts (
install.sh/install.ps1) remain as an alternative but require users to have active GitHub credentials authorized to access the private repository.