qwen-code/packages/cli/src/dualOutput
ChiGao 91476134ae
Some checks are pending
Qwen Code CI / Classify PR (push) Waiting to run
Qwen Code CI / Lint (push) Blocked by required conditions
Qwen Code CI / Test (macos-latest, Node 22.x) (push) Blocked by required conditions
Qwen Code CI / Test (ubuntu-latest, Node 22.x) (push) Blocked by required conditions
Qwen Code CI / Test (windows-latest, Node 22.x) (push) Blocked by required conditions
Qwen Code CI / Post Coverage Comment (push) Blocked by required conditions
Qwen Code CI / CodeQL (push) Blocked by required conditions
E2E Tests / E2E Test (Linux) - sandbox:docker (push) Waiting to run
E2E Tests / E2E Test (Linux) - sandbox:none (push) Waiting to run
E2E Tests / E2E Test - macOS (push) Waiting to run
fix(dual-output): prevent FIFO blocking on startup when no reader connected (#4894)
* fix(dual-output): prevent FIFO blocking on startup when no reader connected

DualOutputBridge's ENXIO fallback used a blocking createWriteStream on
FIFOs, causing the TUI to hang indefinitely when launched with
`--json-file <fifo>` before a reader connects (issue #4727).

Fix: use O_RDWR | O_NONBLOCK for the FIFO fallback path. This POSIX
trick satisfies the kernel's "at least one reader" requirement without
blocking. A buffer high-water-mark (1 MB) self-disables the bridge if
no consumer ever drains the pipe.

Also updates Quick start docs to recommend regular files as the default,
with FIFOs documented as an advanced option that now works without
ordering constraints.

Generated with AI

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

* fix(dual-output): address review feedback — guardActive, stream.destroy, tests

- Rename isBufferOverflowing() to guardActive() (command-query separation)
- Apply buffer guard to all write methods, not just processEvent
- Call stream.destroy() on overflow so FIFO consumers get EOF
- Handle destroyed stream in shutdown() to prevent hanging
- Add test: bridge disables on buffer overflow + stream is destroyed
- Fix doc: --input-file requires regular file (not FIFO), stat.size=0

Generated with AI

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

---------

Co-authored-by: 秦奇 <gary.gq@alibaba-inc.com>
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-06-15 06:04:06 +08:00
..
DualOutputBridge.test.ts fix(dual-output): prevent FIFO blocking on startup when no reader connected (#4894) 2026-06-15 06:04:06 +08:00
DualOutputBridge.ts fix(dual-output): prevent FIFO blocking on startup when no reader connected (#4894) 2026-06-15 06:04:06 +08:00
DualOutputContext.tsx feat(cli): add dual-output sidecar mode for TUI (#3352) 2026-04-18 02:14:53 +08:00
index.ts feat(cli): add dual-output sidecar mode for TUI (#3352) 2026-04-18 02:14:53 +08:00