Commit Graph
7 Commits
Author SHA1 Message Date
Timothy Jaeryang Baek 13afaba925 refac 2026-11-01 23:44:20 +09:00
Timothy Jaeryang Baek f3836da92c refac 2026-11-01 23:24:10 +09:00
Timothy Jaeryang Baek 6852d4d663 refac 2026-10-19 04:00:34 +09:00
Timothy Jaeryang Baek 4240b4e934 refac 2026-10-19 03:32:20 +09:00
Timothy Jaeryang Baek f0edc9ecc5 refac 2026-09-06 15:19:53 -04:00
Timothy Jaeryang Baek 674cf047fc feat: configurable log flush strategy (#65)
Add OPEN_TERMINAL_LOG_FLUSH_INTERVAL and OPEN_TERMINAL_LOG_FLUSH_BUFFER
env vars to control how frequently process output is flushed to disk.
Default 0 preserves existing per-chunk flush behaviour.

Setting FLUSH_INTERVAL=1 reduces fsyncs from ~250/sec to ~1/sec for
high-output commands, preventing I/O storms that can make ARM/eMMC
systems unresponsive.

- Centralize flush control in BoundedLogWriter
- Remove per-chunk flush() from PtyRunner, PipeRunner, WinPtyRunner
- Add explicit final flush before writing process end marker
- Bump version to 0.11.18
2026-03-15 16:24:23 -05:00
Timothy Jaeryang Baek fd5c5deef9 fix: bounded process log rotation and timestamp-sortable IDs (#52, #54)
- Add log rotation: when a process log exceeds MAX_PROCESS_LOG_SIZE (default
  50 MB), the oldest half is discarded and writing continues so the most
  recent output is always available. Prevents unbounded memory growth that
  caused ~26 GB OOM kills.

- Add tail-optimized log reads: _read_log with tail parameter now reads from
  the end of the file instead of loading the entire file into memory.

- Add OPEN_TERMINAL_MAX_LOG_SIZE (default 50 MB) and
  OPEN_TERMINAL_LOG_RETENTION (default 7 days) configuration.

- Use timestamp-prefixed process IDs (YYYYMMDD-HHMMSS-<random>) so log files
  sort chronologically in the filesystem.

- Extract log management into utils/log.py to reduce main.py size.
2026-03-11 16:22:46 -05:00