Fixed
- 🐳 PTY device exhaustion — fixed
OSError: out of pty devicesby closing leaked file descriptors when subprocess creation fails afterpty.openpty(). BothPtyRunner(command execution) andcreate_terminal(interactive sessions) now properly clean up on error paths. - 🛡️ Graceful PTY error handling —
create_terminalnow returns a clear503with a descriptive message when the system runs out of PTY devices, instead of an unhandled server error.
Added
- 🔒 Terminal session limit — new
OPEN_TERMINAL_MAX_SESSIONSenvironment variable (default16) caps the number of concurrent interactive terminal sessions. Dead sessions are automatically pruned before the limit is checked. Returns429when the limit is reached.