Bug Description
kiro-cli acp subcommand fails immediately with error: Bad file descriptor (os error 9) in the minimal variant when run in headless/non-TTY environments (code-server, kubectl exec).
Root Cause
The acp subcommand incorrectly delegates to the bun/tui.js chat binary (q_cli::cli:587: launching q chat binary) instead of handling the stdio-based ACP protocol directly. The parent process creates an internal IPC pipe (fd 9) and passes it to the child bun process, but the child cannot use it in non-TTY contexts.
Environment
- kiro-cli 2.3.0, variant:
minimal
- Ubuntu 24.04 (container), kernel 6.12.79
- code-server 4.117.0 (VS Code 1.117.0), Node.js v22.22.1
- EFS/NFS home directory
- ACP extension: whatnick.acp-client-whatnick 0.1.6
Reproduction
- Install kiro-cli minimal variant in a container/headless environment
- Run
kiro-cli acp (or have code-server ACP extension spawn it)
- Observe:
error: Bad file descriptor (os error 9), exit code 1
Debug Trace
DEBUG q_cli::cli: 582: launching q chat binary
error: Bad file descriptor (os error 9)
stdin fd 0 is /dev/null or a pipe (not a TTY). The spawned bun/tui.js child fails on the IPC fd.
Expected Behavior
kiro-cli acp should start an ACP stdio server that accepts JSON-RPC messages on stdin/stdout without requiring a TTY or spawning the TUI binary.
Actual Behavior
Crashes with Bad file descriptor (os error 9) and exits with code 1.
Diagnostic
[q-details]
version = "2.3.0"
hash = "a44742ad7a3acc79eac7459c2986103a8ad2b756"
variant = "minimal"
Bug Description
kiro-cli acpsubcommand fails immediately witherror: Bad file descriptor (os error 9)in theminimalvariant when run in headless/non-TTY environments (code-server, kubectl exec).Root Cause
The
acpsubcommand incorrectly delegates to the bun/tui.js chat binary (q_cli::cli:587: launching q chat binary) instead of handling the stdio-based ACP protocol directly. The parent process creates an internal IPC pipe (fd 9) and passes it to the child bun process, but the child cannot use it in non-TTY contexts.Environment
minimalReproduction
kiro-cli acp(or have code-server ACP extension spawn it)error: Bad file descriptor (os error 9), exit code 1Debug Trace
stdin fd 0 is
/dev/nullor a pipe (not a TTY). The spawned bun/tui.js child fails on the IPC fd.Expected Behavior
kiro-cli acpshould start an ACP stdio server that accepts JSON-RPC messages on stdin/stdout without requiring a TTY or spawning the TUI binary.Actual Behavior
Crashes with
Bad file descriptor (os error 9)and exits with code 1.Diagnostic