Commit 2abeaa0
authored
fix: stamp finished_at for CandidateRecoverable terminal runs in set_run_state (#9069)
set_run_state's finished_at condition hand-listed 5 of the 6 terminal run
states, omitting CandidateRecoverable. A run that finished with a recoverable
candidate goes through set_run_state (via run_state_for_aggregate in
failure_recording) but never got its lifecycle.execution.finished_at stamped --
even though it is terminal and the legacy-record migration path in health.rs
stamps finished_at for every non-Queued/Running state. The two write paths
disagreed: the exact drift the just-merged is_terminal() consolidation (#9068)
made visible.
Replace the hand-listed subset with state.is_terminal() so the live setter
matches the canonical terminal definition and the migration path. This removes
the last hand-copied terminal-state list.
Regression test asserts a CandidateRecoverable run stamps finished_at and a
Running run does not; verified it FAILS on the pre-fix setter (panics with 'a
terminal CandidateRecoverable run must stamp finished_at') and passes with the
fix.
Verified: agents --lib clean; new test passes with the fix, fails without it.1 parent 4512a77 commit 2abeaa0
2 files changed
Lines changed: 42 additions & 8 deletions
File tree
- crates/homeboy-agents/src/agent_task_lifecycle
- tests
Lines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1311 | 1311 | | |
1312 | 1312 | | |
1313 | 1313 | | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
0 commit comments