2 Commits
Author SHA1 Message Date
辰ing 06e88e50b3 Improve session polling performance and add cross-platform script support
* fix: harden test suite for Windows/CRLF cross-platform compatibility

- oss-readiness: use \r?\n in .gitignore regex boundaries for CRLF support
- oss-readiness: update PUBLIC_FILES to match actual repo filenames
- phase9-routes-commands: invoke node directly instead of spawn('npm')
  to avoid ENOENT on Windows where npm requires .cmd extension
- phase9-routes-commands: normalize path separators in export path assertion
- ui-render-smoke: normalize CRLF to LF before multiline source includes()
- usage-cost: normalize backslashes in sourcePath before glob assertion

All 87 tests now pass on Windows.

* fix: add cross-platform Node.js UI smoke script for Windows compatibility

* fix: improve session polling performance and add cross-platform script support (#13)

- Reduce monitor polling interval from 5s to 30s to cut background I/O by 83%
- Add incremental status queries in snapshot() — only refresh active/new sessions instead of all 500+
- Replace O(n) usage-cost cache key serialization with O(1) generatedAt-based key
- Use cross-env for all env-prefixed npm scripts to fix Windows cmd compatibility
- Reduce default session preview historyLimit and pageSize for faster dashboard loads

* fix: add final status refresh for sessions leaving active state

When a session transitions from running/blocked to idle/error, perform
one last status query to capture final usage metrics (cost, tokens).
Without this, cachedStatuses would retain pre-completion values
permanently, causing stale aggregate usage/budget totals.

Addresses review feedback on PR #17.

* fix: tune polling interval to 10s and use content-based cache key

- Change sessionsList polling from 30s to 10s as a compromise between
  the original 5s (too aggressive) and the PR's 30s (too slow for
  near real-time UX).
- Replace generatedAt-based cache key in buildUsageCostCacheKey with
  content-based fingerprint using session.state and status.updatedAt,
  so the cache only invalidates when data actually changes.
2026-03-14 09:49:45 +01:00
辰ing f3327e3f95 Merge pull request #6 from MoYiC6/fix/cross-platform-test-compatibility
fix: harden test suite for Windows/CRLF cross-platform compatibility
2026-03-13 10:59:04 +01:00