Detection
On every tick (5s), Polpo scans for deadlocks:- Find all
pendingtasks - Check if any depend on
failedtasks (with max retries exhausted) - If found → deadlock detected
deadlock:detected event with the list of blocked task IDs.
LLM Resolution
Polpo evaluates each deadlocked task with an LLM and decides the best action:Strategy: Absorb
The blocked task can proceed without the failed dependency. The LLM modifies the task description to account for the missing work.Strategy: Retry
The failed dependency should be retried because it might succeed with a different approach.pending for another attempt.
Unresolvable
The LLM determines the dependency is truly critical and cannot be worked around.failed.
Configuration
Events
| Event | Payload | When |
|---|---|---|
deadlock:detected | { taskIds, resolvableCount } | Blocked tasks found |
deadlock:resolving | { taskId, failedDepId } | Attempting resolution |
deadlock:resolved | { taskId, failedDepId, action, reason } | Successfully resolved |
deadlock:unresolvable | { taskId, reason } | Cannot resolve |
How It Works Internally
- Detect: Find pending tasks with failed dependencies
- Analyze: Send task descriptions + dependency info to LLM
- Decide: LLM returns action (
absorb,retry, or fail) - Execute: Apply the decision (modify description, retry dep, or fail task)
- Track: Increment
resolutionAttemptson the blocked task - Limit: Stop after
maxResolutionAttemptsto prevent infinite loops
Resolution attempts are tracked per-task via
task.resolutionAttempts. Each blocked task gets at most maxResolutionAttempts chances before being permanently failed.