* fix(cli): prevent unbounded log file growth with size-based rotation
Fix two issues causing log files to grow to 50+ GB:
1. Server middleware leaked a "started" log line for skipped endpoints
because log.time() was called unconditionally — only timer.stop()
was gated by the skipLogging flag. Restructure to early-return for
skipped paths so no logging occurs at all.
2. Log files had no size limit within a session. A long-running
kilo serve process (e.g. VS Code extension) would write a single
file indefinitely. Add rotating-file-stream (50 MB, maxFiles: 1)
to cap log file size automatically.
* fix(cli): address review feedback on log rotation
- Revert server.ts changes (handled separately in #8141)
- Add error/warning event handlers on rotating-file-stream
- Increase maxFiles from 1 to 3 for better debug headroom
- Set explicit history file path to avoid .txt side-effect
* fix(cli): revert maxFiles back to 1
maxFiles: 1 is sufficient — we only need to cap disk usage, not retain
old rotated fragments. The existing cleanup() handles session-level
file retention separately.
* fix(cli): set maxFiles to 10 for log rotation
Every child_process.spawn() call was missing windowsHide: true, causing
a visible CMD console window to briefly appear on every shell command,
LSP server start, ripgrep search, clipboard operation, and process kill
on Windows. This option is a no-op on non-Windows platforms.
Replace Bun.Glob usage with a new Glob utility wrapper around the npm 'glob' package.
This moves us off Bun-specific APIs toward standard Node.js compatible solutions.
Changes:
- Add new src/util/glob.ts utility module with scan(), scanSync(), and match()
- Default include option is 'file' (only returns files, not directories)
- Add symlink option (default: false) to control symlink following
- Migrate all 12 files using Bun.Glob to use the new Glob utility
- Add comprehensive tests for the glob utility
Breaking changes:
- Removed support for include: 'dir' option (use include: 'all' and filter manually)
- symlink now defaults to false (was true in most Bun.Glob usages)
Files migrated:
- src/util/log.ts
- src/util/filesystem.ts
- src/tool/truncation.ts
- src/session/instruction.ts
- src/storage/json-migration.ts
- src/storage/storage.ts
- src/project/project.ts
- src/cli/cmd/tui/context/theme.tsx
- src/config/config.ts
- src/tool/registry.ts
- src/skill/skill.ts
- src/file/ignore.ts
Added default type parameter 'any' to readJson<T> so users can call it without specifying a type when they don't need strict typing. This reduces boilerplate for quick JSON reads where type safety isn't required.