Files
netris-nestri/apps
Wanjohi c467dc082d feat(session): a terminal session says why it ended
`ended` and `failed` say how a run finished but not why: a stop its owner
asked for, a free weekend running out, an idle box and a game quitting on
its own all left the same row behind. A session now carries `end_reason`,
one word from a fixed list, written by whoever ends the run, and
`time_claimed`, stamped when a host takes the run, so bring-up can be
measured from the claim rather than from the request.

The control plane writes the two endings it decides itself: `user` when
the owner stops a run nobody had claimed yet, and `left_queue` when a
waiting run is abandoned. The write keeps a reason only on a terminal
state, the same way an error message is kept only for a failure, so no
row can say it ended while it is still going. Both fields are returned
wherever a session is.

The column is text rather than a database enum so a reason added later
is a code change and not a migration.
2026-10-15 23:25:44 +03:00
..
2026-10-12 13:49:50 +03:00