fix(e2e): suppress matrix email on targeted re-runs via SPAWN_E2E_SKIP_EMAIL (#2944)

When the quality cycle e2e-tester re-runs only failed agents
(e.g. `e2e.sh --cloud hetzner zeroclaw codex`), e2e.sh was firing
a matrix email showing only those 2 agents — both PASS if the retry
succeeded. This looked like "2 tests ran, all passed" when in reality
32 tests ran with 2 failures.

- Add SPAWN_E2E_SKIP_EMAIL=1 env var check at the top of send_matrix_email
- Update qa-quality-prompt.md to set SPAWN_E2E_SKIP_EMAIL=1 on re-runs

Co-authored-by: spawn-qa-bot <qa@openrouter.ai>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
A 2026-03-24 00:17:10 -07:00 committed by GitHub
parent aafeda4020
commit 056ce252c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 1 deletions

View file

@ -161,7 +161,8 @@ cd REPO_ROOT_PLACEHOLDER && git worktree remove WORKTREE_BASE_PLACEHOLDER/TASK_N
- `sh/e2e/lib/common.sh` — API helpers, constants
- `sh/e2e/lib/teardown.sh` — cleanup logic
7. Run `bash -n` on every modified `.sh` file
8. Re-run only the failed agents: `./sh/e2e/e2e.sh --cloud CLOUD AGENT_NAME`
8. Re-run only the failed agents: `SPAWN_E2E_SKIP_EMAIL=1 ./sh/e2e/e2e.sh --cloud CLOUD AGENT_NAME`
(SPAWN_E2E_SKIP_EMAIL=1 suppresses the matrix email on partial re-runs — a partial email falsely looks like all-passed)
9. If changes were made: commit, push, open a PR (NOT draft) with title "fix(e2e): [description]"
10. Clean up worktree when done
11. Report: clouds tested, clouds skipped, agents passed, agents failed, fixed

View file

@ -508,6 +508,14 @@ send_matrix_email() {
local total_fail="$5"
local duration_str="$6"
# Skip email for targeted re-runs (partial agent/cloud subset).
# Set SPAWN_E2E_SKIP_EMAIL=1 to suppress the email (used by quality cycle
# when re-running only failed agents — a partial email looks like all-passed).
if [ "${SPAWN_E2E_SKIP_EMAIL:-0}" = "1" ]; then
log_info "Matrix email skipped (SPAWN_E2E_SKIP_EMAIL=1)"
return 0
fi
local resend_key="${RESEND_API_KEY:-}"
local to_email="${KEY_REQUEST_EMAIL:-}"