agentd: fix graceful shutdown (SIGTERM handling)

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

Description

Edit

agentd does not shut down gracefully on SIGTERM. systemd sends SIGTERM, waits the timeout, then sends SIGKILL. The service should: (1) catch SIGTERM, (2) send SIGTERM to all child pi processes, (3) wait briefly for them to exit, (4) close log handles and clean up, (5) exit 0. Currently it hangs, likely because the log reader threads or child process watchers aren't being interrupted.

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: Signal handler uses MVar to prevent double-shutdown. Calls exitSuccess after gracefulShutdown. Wraps per-agent stop in try/catch. Closes SQLite on shutdown.

💬[human]1 week ago

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

🔄[human]Review → Verified1 week ago