Orchestrator async thread dies silently without notification

t-330·WorkTask·
·
·
·Omni/Agent/Telegram/Orchestrator.hs
Created1 month ago·Updated1 month ago

Description

Edit

When the orchestrator async thread crashes or dies, there is no notification to the user and no error logging. The subprocess becomes a zombie and the user never knows what happened.

Observed Behavior

1. Orchestrator spawns pi-code.sh subprocess 2. pi-code.sh runs pi and completes successfully 3. Subprocess exits but becomes zombie (parent didn't wait) 4. No Telegram notification of completion or failure 5. User left wondering what happened

Root Cause

The Async.async thread that runs the orchestrator can die silently. Even with try/catch inside, if something goes wrong between spawning and the try block, or if there's an async exception, it won't be caught.

Fix

1. Wrap entire async body in try/catch with logging 2. Use Async.withAsync or link the async to ensure exceptions propagate 3. Add finally block to always unregister and notify on exit 4. Add periodic heartbeat logging so we can see the thread is alive

Timeline (2)

🔄[human]Open → InProgress1 month ago
🔄[human]InProgress → Done1 month ago