Bug Fixes (8)
- SessionEnd hooks cancelled on exit — hooks now have
async: trueso they complete in the background instead of getting killed. Fixes #1. - cacheDir temporal dead zone —
const cacheDirwas used before declaration in statusline.js.live-fill.jsonwas never written, causing quality scores to silently fall back to less accurate char-count estimation. Fixed by moving declaration. - Hook duplication — plugin hooks.json and settings.json both registered the same commands, causing collect, dashboard, and quality-cache to run twice per event. Removed duplicates from settings.json; plugin hooks are now the single source of truth.
- Statusline crash on out-of-range context % — negative or >100
used_percentagecausedString.repeat()with negative count, silently killing the entire statusline. Fixed with clamping to [0, 100]. - SQLite busy_timeout missing — all 4
sqlite3.connect()call sites now setPRAGMA busy_timeout=5000. PreventsSQLITE_BUSYerrors during concurrent session endings. - Non-atomic live-fill.json write — replaced
writeFileSyncwith tempfile + rename to prevent concurrent readers from seeing truncated JSON. - session_id path injection — session IDs are now sanitized to alphanumeric characters before use in filesystem paths.
- SQLite connection leak —
_collect_trends_from_db()now uses try/finally to ensure connections are always closed.
New
/token-dashboardskill — one command to collect latest session data and open the dashboard in your browser.
Internal
setup_hook()andhooks-starter.jsonnow includeasync: truefor SessionEnd hooks.- Version synced across plugin.json and marketplace.json.