Conversation
- Add count_fruitless_tasks_for_issue_stage (failed OR completed-without-effects) - should_skip_due_to_failures now counts fruitless tasks instead of only failed tasks, catching Qwen empty-output infinite spawn loops - Generalize circuit breaker from reviewer-only to all stages: non-reviewer stages with max_stage_attempts use attempt_limit * 2 as total-task cap - Add tests: fruitless_count_* (5 unit tests), poll_circuit_breaker_blocks_ excessive_engineer_spawns, poll_fruitless_cap_blocks_empty_completions
Code reviewFound 1 issue:
A Qwen agent completing with empty output (no effects) will accumulate toward the fruitless cap but produce zero cooldown delay — rapid-fire spawning continues until the cap triggers. With werma/engine/src/pipeline/poll.rs Lines 1271 to 1285 in 98f5714 The werma/engine/src/db/pipeline.rs Lines 384 to 395 in 98f5714 Fix: add 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
The cooldown timer in should_skip_due_to_failures() only queried failed tasks, while the cap was already updated to count fruitless completions. This allowed rapid-fire spawning of fruitless tasks (e.g. Qwen empty output) with zero cooldown delay until the cap triggered. Add last_fruitless_task_time_for_issue_stage() query that mirrors the fruitless count predicate (failed OR completed-without-effects) and use it in the cooldown guard so both guards are symmetric.
Summary
Pipeline engineer task
20260409-002.Linear: RIG-405