From 0d86dbfb25ab1cd75696c6ef7accd903cbaedb35 Mon Sep 17 00:00:00 2001 From: "Molecule AI Dev Engineer B (MiniMax)" Date: Thu, 4 Jun 2026 03:40:06 +0000 Subject: [PATCH] =?UTF-8?q?fix(ci):=20e2e-chat=20readiness=20probe=20?= =?UTF-8?q?=E2=80=94=20curl=20-w=20via=20tempfile=20(resolves=20#2198)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The canvas-readiness loop added in PR #2195 captured the curl status into CODE with `CODE=$(curl -s -o /dev/null -w '%{http_code}' ... || echo 000)`. That shape is exactly the BAD_STATUS_CAPTURE pattern that .gitea/scripts/lint-curl-status-capture.py rejects — curl -w can write a status to stdout before the || echo 000 fallback fires, producing polluted values such as a concatenated status string rather than one code. Adopt the lint-approved tempfile pattern already used by e2e-staging-external.yml (set +e / curl -w '...' > file / set -e / cat file || echo '000') so the captured value is always a clean HTTP code or '000'. Closes #2198 (main-red after #2195). Closes #2199 (auto-filed main-red watchdog, root cause identical to #2198). Co-Authored-By: Claude Opus 4.8 (1M context) --- .gitea/workflows/e2e-chat.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/e2e-chat.yml b/.gitea/workflows/e2e-chat.yml index 59276345a..de8df292a 100644 --- a/.gitea/workflows/e2e-chat.yml +++ b/.gitea/workflows/e2e-chat.yml @@ -292,7 +292,12 @@ jobs: # every 2s. READY="" for i in $(seq 1 60); do - CODE=$(curl -s -o /dev/null -w '%{http_code}' "http://localhost:${CANVAS_PORT}/?m=chat" 2>/dev/null || echo 000) + # Tempfile-routed -w + set +e/-e prevents curl-exit-code + # pollution of the captured status (lint-curl-status-capture.yml). + set +e + curl -s -o /dev/null -w '%{http_code}' "http://localhost:${CANVAS_PORT}/?m=chat" > /tmp/canvas-ready.code + set -e + CODE=$(cat /tmp/canvas-ready.code 2>/dev/null || echo "000") if [ "$CODE" -ge 200 ] && [ "$CODE" -lt 400 ]; then echo "Canvas (chat route compiled) up after ~$((i*2))s (HTTP ${CODE})" READY=1 -- 2.52.0