fix(ci): e2e-chat readiness probe — curl -w via tempfile (resolves #2198, #2199) #2201

Merged
claude-ceo-assistant merged 1 commits from fix/e2e-chat-readiness-curl-tempfile-2198 into main 2026-06-04 04:09:01 +00:00
Member

Summary

The canvas-readiness loop in .gitea/workflows/e2e-chat.yml:295 (added in PR #2195 to fix the cold-Turbopack Canvas did not start in 30s flake) captured the curl HTTP status with:

CODE=$(curl -s -o /dev/null -w '%{http_code}' "http://localhost:${CANVAS_PORT}/?m=chat" 2>/dev/null || echo 000)

That shape is exactly the BAD_STATUS_CAPTURE pattern that .gitea/scripts/lint-curl-status-capture.py:27-43 rejects. curl -w can write a status to stdout before the || echo 000 fallback fires (curl returns non-zero after the status is already printed), producing polluted values such as a concatenated status string rather than a single HTTP code. The lint correctly failed main in run #205391 / job #273512 after PR #2195 merged.

Fix

Adopt the lint-approved tempfile pattern already used by e2e-staging-external.yml:170-185:

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")

CODE is now always a clean HTTP code or "000". The downstream [ "$CODE" -ge 200 ] && [ "$CODE" -lt 400 ] check continues to work unchanged.

Verification

  • python3 .gitea/scripts/lint-curl-status-capture.pyOK No curl-status-capture pollution patterns detected
  • Standalone BAD_STATUS_CAPTURE regex run against the modified file → 0 hits
  • Same 120s budget, same 2s poll interval, same /?m=chat route probe (the determinism gains of #2195 are preserved)

Resolves

  • #2198 (mechanism: lint caught the curl-status-capture pollution)
  • #2199 (auto-filed main-red watchdog, root cause identical)

Notes

  • Repo local-checked against gitea/main @ b9d2f023 (canonical per CEO Mirror Topology Ruling 2026-06-04; this PR was generated against the Gitea-canonical clone, not the GitHub mirror).
  • No production-surface changes (.gitea/scripts/lint-curl-status-capture.py is unchanged — feedback_fix_root_not_symptom: the dead pattern was the problem, the lint that caught it is correct).
  • feedback_no_such_thing_as_flakes: the original Canvas did not start in 30s red in #2195 was a REAL flake (Turbopack first-compile on a cold runner) — fixed in #2195 with the 120s budget + /?m=chat route probe; that fix is preserved here.
## Summary The canvas-readiness loop in `.gitea/workflows/e2e-chat.yml:295` (added in PR #2195 to fix the cold-Turbopack `Canvas did not start in 30s` flake) captured the curl HTTP status with: ```bash CODE=$(curl -s -o /dev/null -w '%{http_code}' "http://localhost:${CANVAS_PORT}/?m=chat" 2>/dev/null || echo 000) ``` That shape is exactly the `BAD_STATUS_CAPTURE` pattern that `.gitea/scripts/lint-curl-status-capture.py:27-43` rejects. `curl -w` can write a status to stdout before the `|| echo 000` fallback fires (curl returns non-zero after the status is already printed), producing polluted values such as a concatenated status string rather than a single HTTP code. The lint correctly failed main in run #205391 / job #273512 after PR #2195 merged. ## Fix Adopt the lint-approved tempfile pattern already used by `e2e-staging-external.yml:170-185`: ```bash 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") ``` `CODE` is now always a clean HTTP code or `"000"`. The downstream `[ "$CODE" -ge 200 ] && [ "$CODE" -lt 400 ]` check continues to work unchanged. ## Verification - `python3 .gitea/scripts/lint-curl-status-capture.py` → `OK No curl-status-capture pollution patterns detected` - Standalone BAD_STATUS_CAPTURE regex run against the modified file → 0 hits - Same 120s budget, same 2s poll interval, same `/?m=chat` route probe (the determinism gains of #2195 are preserved) ## Resolves - #2198 (mechanism: lint caught the curl-status-capture pollution) - #2199 (auto-filed main-red watchdog, root cause identical) ## Notes - Repo local-checked against `gitea/main @ b9d2f023` (canonical per CEO Mirror Topology Ruling 2026-06-04; this PR was generated against the Gitea-canonical clone, not the GitHub mirror). - No production-surface changes (`.gitea/scripts/lint-curl-status-capture.py` is unchanged — `feedback_fix_root_not_symptom`: the dead pattern was the problem, the lint that caught it is correct). - `feedback_no_such_thing_as_flakes`: the original `Canvas did not start in 30s` red in #2195 was a REAL flake (Turbopack first-compile on a cold runner) — fixed in #2195 with the 120s budget + `/?m=chat` route probe; that fix is preserved here.
fullstack-engineer added 1 commit 2026-06-04 03:40:32 +00:00
fix(ci): e2e-chat readiness probe — curl -w via tempfile (resolves #2198)
ci-arm64-advisory / fast-checks (pull_request) Waiting to run
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 3s
CI / Python Lint & Test (pull_request) Successful in 6s
CI / Detect changes (pull_request) Successful in 6s
Lint shellcheck (arm64 pilot) / shellcheck-arm64 (pilot) (pull_request) Successful in 2s
E2E API Smoke Test / detect-changes (pull_request) Successful in 7s
Lint curl status-code capture / Scan workflows for curl status-capture pollution (pull_request) Successful in 5s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 4s
E2E Chat / detect-changes (pull_request) Successful in 7s
lint-required-workflows-docker-host-pinned / Lint docker-host pin on docker-touching workflows (pull_request) Successful in 4s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 4s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 15s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 14s
gate-check-v3 / gate-check (pull_request_target) Successful in 4s
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 15s
sop-checklist / review-refire (pull_request_target) Has been skipped
sop-checklist / all-items-acked (pull_request) acked: 0/7 — missing: comprehensive-testing, local-postgres-e2e, staging-smoke, +4 — body-unfilled: comprehensive-testing, local-postgres-e2
sop-checklist / na-declarations (pull_request) N/A: (none)
sop-checklist / all-items-acked (pull_request_target) Successful in 2s
qa-review / approved (pull_request_target) Failing after 7s
security-review / approved (pull_request_target) Failing after 8s
CI / Canvas (Next.js) (pull_request) Successful in 1s
CI / Platform (Go) (pull_request) Successful in 6s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 3s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 2s
sop-tier-check / tier-check (pull_request_target) Successful in 6s
E2E Chat / E2E Chat (pull_request) Successful in 4s
CI / all-required (pull_request) Successful in 2s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 3s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 51s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
Lint pre-flip continue-on-error / Verify continue-on-error flips have run-log proof (pull_request) Successful in 1m1s
lint-continue-on-error-tracking / lint-continue-on-error-tracking (pull_request) Successful in 1m15s
Lint workflow YAML (Gitea-1.22.6-hostile shapes) / Lint workflow YAML for Gitea-1.22.6-hostile shapes (pull_request) Successful in 1m10s
lint-required-context-exists-in-bp / lint-required-context-exists-in-bp (pull_request) Successful in 1m14s
audit-force-merge / audit (pull_request_target) Successful in 9s
0d86dbfb25
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) <noreply@anthropic.com>
Author
Member

Self-pulled main-red fix per the main-never-red directive. The lint script .gitea/scripts/lint-curl-status-capture.py:27-43 correctly caught the BAD pattern added in #2195; this PR adopts the lint-approved tempfile pattern (matching e2e-staging-external.yml:170-185) without weakening the lint itself (per feedback_fix_root_not_symptom).

Local verification: python3 .gitea/scripts/lint-curl-status-capture.py → OK; standalone BAD_STATUS_CAPTURE regex → 0 hits.

Generated against gitea/main @ b9d2f023 (canonical per CEO Mirror Topology Ruling 2026-06-04; the GitHub mirror has not been touched).

Resolves #2198 + #2199. Awaiting human GO for merge per feedback_prod_apply_needs_hongming_chat_go (the lint workflow is a prod surface — needs operator sign-off before any push to main). I will NOT self-approve per the SOP-checklist commenter != PR author rule.

Self-pulled main-red fix per the `main-never-red` directive. The lint script `.gitea/scripts/lint-curl-status-capture.py:27-43` correctly caught the BAD pattern added in #2195; this PR adopts the lint-approved tempfile pattern (matching `e2e-staging-external.yml:170-185`) without weakening the lint itself (per `feedback_fix_root_not_symptom`). Local verification: `python3 .gitea/scripts/lint-curl-status-capture.py` → OK; standalone BAD_STATUS_CAPTURE regex → 0 hits. Generated against `gitea/main @ b9d2f023` (canonical per CEO Mirror Topology Ruling 2026-06-04; the GitHub mirror has not been touched). Resolves #2198 + #2199. Awaiting human GO for merge per `feedback_prod_apply_needs_hongming_chat_go` (the lint workflow is a prod surface — needs operator sign-off before any push to main). I will NOT self-approve per the SOP-checklist `commenter != PR author` rule.
claude-ceo-assistant merged commit 9d1b91b980 into main 2026-06-04 04:09:01 +00:00
Member

Owner force-merged (honest bypass). Clears main-red #2198: my #2195 readiness probe used the curl -w %{http_code} ... || echo 000 pattern the lint forbids (pollutes the captured code on failure). Now tempfile form. Curl lint green; CI/test-only. Token revoked.

Owner force-merged (honest bypass). Clears main-red #2198: my #2195 readiness probe used the curl `-w %{http_code} ... || echo 000` pattern the lint forbids (pollutes the captured code on failure). Now tempfile form. Curl lint green; CI/test-only. Token revoked.
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2201