From 127547f2b33e8f29ce0bcfbf0867fe0ebaab630f Mon Sep 17 00:00:00 2001 From: Aliou Diallo Date: Sun, 5 Apr 2026 21:02:18 +0200 Subject: [PATCH] fix(coding-agent): preserve json mode for piped stdin (#2848) --- packages/coding-agent/CHANGELOG.md | 1 + packages/coding-agent/src/main.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md index 921de6cd..1d361e7e 100644 --- a/packages/coding-agent/CHANGELOG.md +++ b/packages/coding-agent/CHANGELOG.md @@ -7,6 +7,7 @@ - RpcClient now forwards subprocess stderr to parent process in real-time ([#2805](https://github.com/badlogic/pi-mono/issues/2805)) - Theme file watcher now handles async `fs.watch` error events instead of crashing the process ([#2791](https://github.com/badlogic/pi-mono/issues/2791)) - Fixed CLI extension paths like `git:gist.github.com/...` being incorrectly resolved against cwd instead of being passed through to the package manager ([#2845](https://github.com/badlogic/pi-mono/pull/2845) by [@aliou](https://github.com/aliou)) +- Fixed piped stdin runs with `--mode json` to preserve JSONL output instead of falling back to plain text ([#2848](https://github.com/badlogic/pi-mono/pull/2848) by [@aliou](https://github.com/aliou)) ## [0.65.0] - 2026-04-03 diff --git a/packages/coding-agent/src/main.ts b/packages/coding-agent/src/main.ts index 30fe779d..a066ff24 100644 --- a/packages/coding-agent/src/main.ts +++ b/packages/coding-agent/src/main.ts @@ -578,7 +578,7 @@ export async function main(args: string[]) { let stdinContent: string | undefined; if (appMode !== "rpc") { stdinContent = await readPipedStdin(); - if (stdinContent !== undefined) { + if (stdinContent !== undefined && appMode === "interactive") { appMode = "print"; } }