Hint pty allocation failures for macOS ENXIO (#4917)

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
Brennan Benson
2026-06-08 16:36:04 -07:00
committed by GitHub
co-authored by Orca
parent a9ec35a132
commit d1d223d691
2 changed files with 7 additions and 0 deletions
@@ -42,6 +42,12 @@ describe('node-pty diagnostic error hints', () => {
expect(addNodePtyRecoveryHint(message)).toBe(`${PTY_ALLOCATION_HINT} ${message}`)
})
it('hints when macOS cannot configure a pty master device', () => {
const message = 'node-pty: posix_openpt failed: errno (errno 6, Device not configured)'
expect(addNodePtyRecoveryHint(message)).toBe(`${PTY_ALLOCATION_HINT} ${message}`)
})
it('hints local wrapped spawn errors from pty allocation failures', () => {
const message =
'Failed to spawn shell "/bin/zsh": node-pty: open_slave failed: EMFILE (errno 24, Too many open files) - slave=\'/dev/ttys003\' (shell: /bin/zsh, cwd: /tmp, arch: arm64, platform: darwin 25.0.0). If this persists, please file an issue.'
+1
View File
@@ -17,6 +17,7 @@ const PTY_ALLOCATION_STEPS = new Set([
])
const RESOURCE_EXHAUSTION_ERRNOS = new Set([
6, // ENXIO on macOS: posix_openpt could not provide a usable pty device
11, // EAGAIN on Linux
12, // ENOMEM
23, // ENFILE on macOS