fix(coding-agent): suppress informational output in non-interactive modes

In -p, --mode json, and --mode rpc modes, don't print informational
messages like 'Loaded project context from:' or model restore messages.
Only the actual output should be printed.
This commit is contained in:
Mario Zechner 2025-11-21 22:07:17 +01:00
parent b49a017c55
commit 56450a4f19
2 changed files with 11 additions and 227 deletions

View file

@ -745,7 +745,9 @@ export async function main(args: string[]) {
// Having initial messages doesn't make it non-interactive anymore
const isInteractive = !parsed.print && parsed.mode === undefined;
const mode = parsed.mode || "text";
const shouldPrintMessages = isInteractive || mode === "text";
// Only print informational messages in interactive mode
// Non-interactive modes (-p, --mode json, --mode rpc) should be silent except for output
const shouldPrintMessages = isInteractive;
// Non-interactive mode: fail early if no model available
if (!isInteractive && !initialModel) {