A finished session says why it ended; bash <(curl …) -u updates a host (#413)

- **Sessions (#412):** `end_reason` and `time_claimed`, with migration
`0026_session_end_reason` (two nullable columns, readable by the release
it replaces). `POST /session/:id/state` takes an optional `endReason`,
and a run stopped before it went live can now go from `starting` to
`ended`.
- **Installer (#411):**
- `bash <(curl -fsSL https://api.nestri.io/install.sh) -u` updates a
host; `-h` prints help; a plain token installs.
  - When the script is not root, it asks sudo itself.
  - The installed host agent version is unchanged (0.2.18).

**Ships before host agent 0.2.19**, which sends `endReason` and the new
transition.

Cut from prod with dev's files, so squash histories cannot conflict; the
tree is identical to dev.
This commit is contained in:
Wanjohi
2026-10-15 21:35:26 +00:00
committed by GitHub
parent 21c80ecab5
commit ed465dae51
11 changed files with 4278 additions and 32 deletions
+5 -1
View File
@@ -146,7 +146,11 @@ describe('the line for a full host', () => {
await Session.setState({ id: playing.run.id, state: 'ended' });
expect((await h.jobs()).map((j) => j.sessionId)).toEqual([here.run.id]);
const left = await Session.fromID(gone.run.id);
expect(left).toMatchObject({ state: 'ended', errorMessage: 'Left the queue' });
expect(left).toMatchObject({
state: 'ended',
errorMessage: 'Left the queue',
endReason: 'left_queue'
});
});
test('a run with a slot is not in line', async () => {