feat(headless): gate diagnostic output behind --debug flag

Diagnostic monitoring data (auth_method, user_tier, api_requests,
api_errors, retry_count, RETRY events, LOOP_DETECTED events, and
stderr warnings) is now only emitted when --debug / -d is passed.

Without the flag, headless output is identical to before — no new
fields, no new events, no stderr noise. This keeps default output
clean for piped workflows while making diagnostics available on demand.
This commit is contained in:
Dmitry Lyalin
2026-02-25 09:52:14 -08:00
parent a4b3229513
commit 941a479855
4 changed files with 50 additions and 33 deletions
+2 -2
View File
@@ -96,8 +96,8 @@ for model in "${MODELS[@]}"; do
STDERRFILE=$(mktemp)
exit_code=0
echo -e " ${DIM}Running with -o stream-json ...${RESET}"
node "$CLI" -p "$PROMPT" -y -m "$model" -o stream-json \
echo -e " ${DIM}Running with -o stream-json -d ...${RESET}"
node "$CLI" -p "$PROMPT" -y -m "$model" -o stream-json -d \
>"$TMPFILE" 2>"$STDERRFILE" || exit_code=$?
if [[ $exit_code -ne 0 ]]; then