v0.3.9 - Monitor Bug Fix (2025-12-23)¶
What Changed?¶
This release fixes a critical issue in the real-time TUI monitor where piped event streams would stop processing halfway through, displaying "Waiting for events..." even though more events were arriving. The fix ensures all delayed/batched events in the queue are processed before the monitor shuts down.
What's New¶
Bug Fix: StdinMonitor Delayed Event Processing¶
What it does: The monitor now correctly waits for delayed events that arrive after the stdin reader closes (sends EOF sentinel). Previously, the event processing loop would exit immediately upon receiving EOF, losing all queued events. The fix allows the monitor to wait up to 200 seconds for delayed events before shutting down.
How to use it: No changes to usage. Simply pipe detector data as usual:
uv run kazunoko generate 100 | uv run monitor.py
The monitor will now process all events, including those that arrive with delays after stdin closes.
Technical details:
- Changed main loop from
while self.running:towhile True:with explicit break condition - Increased post-sentinel wait timeout from 0.5s to 2.0s per queue poll cycle
- Extended total wait time to 200 seconds (100 × 2.0s) for delayed event arrival
- Updated thread join timeout to 90 seconds to allow full wait completion
Installation¶
Quick Start¶
# Get the release
git checkout v0.3.9
# Setup
uv sync
# Run CLI
uv run kazunoko --help
# Test with piped data
uv run kazunoko generate 50 | python examples/monitor.py
What's Different from the Last Version?¶
🐛 Fixed¶
- Critical: Monitor now processes all delayed events after stdin EOF instead of stopping prematurely
- Issue: "Waiting for events..." would display when events were still in queue
- Impact: Ensures 100% event capture in piped monitoring workflows
Is It Safe to Upgrade?¶
Backward Compatible: Yes
- No changes to CLI interface or public API
- All existing usage patterns work identically
- Only internal monitor processing logic changed
- Fixes data loss issue without breaking changes
Tests Passed¶
- ✅ Builds without errors
- ✅ Pre-commit hooks pass
- ✅ Version bump successful
- ✅ Monitor processes all queued events after sentinel
Release Details¶
- Date: 2025-12-23
- Version: v0.3.9
- Files Changed: 1 (examples/monitor.py)
- Commits:
4d3970d- Fix StdinMonitor sentinel timeout handling1c6165e- Bump version 0.3.8 → 0.3.9
Next Steps¶
- Monitor real-world detector pipelines to validate event capture completeness
- Consider adding telemetry to track delayed event arrival patterns
- Evaluate whether 200s timeout is appropriate for production deployments