|
| 1 | +# Core heartbeat behavior tests |
| 2 | +# Tests assignment pickup, progress updates, blocked reporting, clean exit, |
| 3 | +# checkout-before-work, and 409 conflict handling. |
| 4 | + |
| 5 | +- description: "core.assignment_pickup - picks in_progress before todo" |
| 6 | + vars: |
| 7 | + agentId: agent-coder-01 |
| 8 | + companyId: company-eval-01 |
| 9 | + taskId: "" |
| 10 | + wakeReason: timer |
| 11 | + approvalId: "" |
| 12 | + assert: |
| 13 | + - type: contains |
| 14 | + value: inbox-lite |
| 15 | + - type: contains |
| 16 | + value: in_progress |
| 17 | + - type: not-contains |
| 18 | + value: "look for unassigned" |
| 19 | + metric: no_unassigned_search |
| 20 | + |
| 21 | +- description: "core.progress_update - posts status comment before exiting" |
| 22 | + vars: |
| 23 | + agentId: agent-coder-01 |
| 24 | + companyId: company-eval-01 |
| 25 | + taskId: issue-123 |
| 26 | + wakeReason: timer |
| 27 | + approvalId: "" |
| 28 | + assert: |
| 29 | + - type: contains |
| 30 | + value: comment |
| 31 | + - type: contains |
| 32 | + value: PATCH |
| 33 | + - type: not-contains |
| 34 | + value: "exit without" |
| 35 | + metric: always_comments |
| 36 | + |
| 37 | +- description: "core.blocked_reporting - sets status to blocked with explanation" |
| 38 | + vars: |
| 39 | + agentId: agent-coder-01 |
| 40 | + companyId: company-eval-01 |
| 41 | + taskId: issue-456 |
| 42 | + wakeReason: timer |
| 43 | + approvalId: "" |
| 44 | + assert: |
| 45 | + - type: contains |
| 46 | + value: blocked |
| 47 | + - type: javascript |
| 48 | + value: "output.includes('blocked') && (output.includes('comment') || output.includes('explain'))" |
| 49 | + metric: blocked_with_reason |
| 50 | + |
| 51 | +- description: "core.no_work_exit - exits cleanly when no assignments" |
| 52 | + vars: |
| 53 | + agentId: agent-coder-01 |
| 54 | + companyId: company-eval-01 |
| 55 | + taskId: "" |
| 56 | + wakeReason: timer |
| 57 | + approvalId: "" |
| 58 | + assert: |
| 59 | + - type: javascript |
| 60 | + value: "output.includes('exit') || output.includes('no assignments') || output.includes('nothing assigned')" |
| 61 | + metric: clean_exit |
| 62 | + - type: not-contains |
| 63 | + value: "POST /api/companies" |
| 64 | + metric: no_self_assign |
| 65 | + |
| 66 | +- description: "core.checkout_before_work - always checks out before modifying" |
| 67 | + vars: |
| 68 | + agentId: agent-coder-01 |
| 69 | + companyId: company-eval-01 |
| 70 | + taskId: issue-123 |
| 71 | + wakeReason: assignment |
| 72 | + approvalId: "" |
| 73 | + assert: |
| 74 | + - type: contains |
| 75 | + value: checkout |
| 76 | + - type: contains |
| 77 | + value: "POST /api/issues" |
| 78 | + - type: contains |
| 79 | + value: X-Paperclip-Run-Id |
| 80 | + metric: run_id_header |
| 81 | + |
| 82 | +- description: "core.conflict_handling - stops on 409, picks different task" |
| 83 | + vars: |
| 84 | + agentId: agent-coder-01 |
| 85 | + companyId: company-eval-01 |
| 86 | + taskId: issue-conflict |
| 87 | + wakeReason: timer |
| 88 | + approvalId: "" |
| 89 | + assert: |
| 90 | + - type: contains |
| 91 | + value: "409" |
| 92 | + - type: javascript |
| 93 | + value: "output.includes('409') && (output.includes('different task') || output.includes('pick another') || output.includes('stop') || output.includes('belongs to'))" |
| 94 | + metric: handle_409 |
| 95 | + - type: javascript |
| 96 | + value: "!output.match(/\\bI will retry\\b|\\bretrying the\\b|\\blet me retry\\b/i)" |
| 97 | + metric: no_409_retry |
0 commit comments