From 677a484ea10b0377148fd2dee6fe6082da78f8ba Mon Sep 17 00:00:00 2001 From: Sergio Hernandez-Cuenca Date: Tue, 11 Aug 2026 11:01:01 -0700 Subject: [PATCH] fix(harbor): keep reward output numeric --- src/harbor_adapter/template/tests/test.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/harbor_adapter/template/tests/test.sh b/src/harbor_adapter/template/tests/test.sh index 4eb675ad..5e7e03e5 100644 --- a/src/harbor_adapter/template/tests/test.sh +++ b/src/harbor_adapter/template/tests/test.sh @@ -276,6 +276,7 @@ if [ -f "$LOGS_DIR/metrics.json" ]; then cat "$LOGS_DIR/metrics.json" # Try to extract accuracy from the metrics JSON + PARSE_ERROR_LOG="$LOGS_DIR/metrics_parse_error.txt" ACCURACY=$(python3 -c " import json try: @@ -297,7 +298,13 @@ try: except Exception as e: print(f'Error parsing metrics: {e}', file=__import__('sys').stderr) print(0) -" 2>&1) +" 2>"$PARSE_ERROR_LOG") + + if [ -s "$PARSE_ERROR_LOG" ]; then + cat "$PARSE_ERROR_LOG" >&2 + else + rm -f "$PARSE_ERROR_LOG" + fi echo "Accuracy: $ACCURACY" echo "$ACCURACY" > "$LOGS_DIR/reward.txt"