agentd: close log handle properly when pi crashes

t-562·WorkTask·
·
·
·Omni/Agent.hs
Created2 months ago·Updated1 week ago·pipeline runs →

Description

Edit

When pi crashes (e.g. due to EROFS or other errors), agentd's Haskell-side log reader loop continues trying to write to the closed handle. This spams journalctl with hundreds of identical 'hPutStr: illegal operation (handle is closed)' errors. Fix: detect when the pi process has exited and close/stop the log reader loop cleanly. The reader should catch the IOException from the closed handle and terminate gracefully.

Git Commits

b697c457agentd: fix log handle close, webhook validation, graceful shutdown
Coder Agent9 weeks ago1 files

Timeline (7)

🔄[human]Open → InProgress2 months ago
🔄[human]InProgress → Review2 months ago
💬[human]2 months ago

Fixed in b697c45: readPiOutput/readPiStderr use IORef to track log handle health. After first write failure, all future writes are skipped. Also stops reading on broken pipe.

💬[human]1 week ago

Ava verified: cited commit confirmed in live history; feature shipped. Moving to Verified.

🔄[human]Review → Verified1 week ago