Commit 7a8dca4
committed
Persist run.json's turn count at every turn boundary
The mid-run progress snapshot in the TUI runner only re-fired on
reactor.done, which fires exactly once, at agent shutdown, and never
between turns of a long-lived interactive session. A live monorepo
session showed run.json stuck at turnsUsed: 0 and status: running for
its entire multi-turn lifetime, with dozens of completed turns
already in context/turns.jsonl -- resume pickers and anything else
trusting run.json had no truthful signal until the process closed.
inference.done is the turn boundary every reactor cycle guarantees
(the same one the shell's run-idle transition keys off), so key the
snapshot write off that instead. The terminal write on clean exit and
the crash path both already write through directly with the final
status, so this only changes progress snapshots taken while the run
is still live.1 parent cad9a29 commit 7a8dca4
2 files changed
Lines changed: 27 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
204 | 216 | | |
205 | 217 | | |
206 | 218 | | |
| |||
1399 | 1411 | | |
1400 | 1412 | | |
1401 | 1413 | | |
1402 | | - | |
| 1414 | + | |
1403 | 1415 | | |
1404 | 1416 | | |
1405 | 1417 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
24 | 38 | | |
25 | 39 | | |
26 | 40 | | |
| |||
0 commit comments