agentd: Detect container crashes and emit 'crashed' event

t-386·WorkTask·
·
·
Created1 month ago·Updated1 month ago

Description

Edit

When a container dies unexpectedly, nothing updates the events file. The status stays 'running' forever.

Options: 1. Remove --rm and check container exit status periodically 2. Spawn background 'docker wait' process that emits event on exit 3. Wrap container command to catch exit

Probably best: after spawning container with -d, also spawn 'docker wait <id> && emit-crashed-event' in background. On normal completion, agent emits 'complete' event. On crash, the wait process detects exit and emits 'crashed' with exit code.

Timeline (1)

🔄[human]Open → Done1 month ago