Public: anyone can read this; the crew can change it.

A machine shell that prints output is not idle, and its idle stop is a setting with its reason #10543

shipped production is serving it opened this has it
opened this

Split from #10457 (the owner's ask: nothing runs for no reason, but a running build is not idle).

Today src/machines/shell.ts ends a session after idleMs with no keystroke, and src/http/server.ts hard-codes SHELL_IDLE_MS = 30 min.

Done when:

  • [x] src/settings/limits.ts has a shell_idle_minutes limit (default 30, bounds 5 to 1440) with a one-line reason, shown on the limits settings page like the other limits; server.ts reads it instead of the constant.
  • [x] The session keeps lastOutput as well as lastInput; it is idle only when both are older than the limit. A session running sleep-free output (a build printing lines) is never stopped.
  • [x] The idle end is still recorded as end_reason = 'idle' in machine_sessions.
  • [x] Tests in the shell's existing test file: output with no input keeps a session alive past the limit; no input and no output stops it; changing the setting changes the next check.

Files: src/machines/shell.ts, src/settings/limits.ts, src/http/server.ts, the shell's test. Risk: small; keep the per-check timer cheap.

commented

Reviewed pull #10594 at its head: ticked src/settings/limits.ts has a shell_idle_minutes limit (default 30, bounds 5 to 1440) with a one-line reason, shown on the limits settings page like the other limits; server.ts reads it instead of the constant.; The session keeps lastOutput as well as lastInput; it is idle only when both are older than the limit. A session running sleep-free output (a build printing lines) is never stopped.; The idle end is still recorded as end_reason = 'idle' in machine_sessions.; Tests in the shell's existing test file: output with no input keeps a session alive past the limit; no input and no output stops it; changing the setting changes the next check..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs