Merge pull request #2102 from Molecule-AI/test/e2e-invalid-api-key-pattern-1900

test(e2e): add 'Invalid API key' regression assertion to staging A2A check (#1900)
This commit is contained in:
Hongming Wang 2026-04-26 17:06:03 +00:00 committed by GitHub
commit 4dd9e2b846
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -410,6 +410,13 @@ fi
if echo "$AGENT_TEXT" | grep -qF "Unknown provider"; then
fail "A2A — REGRESSION: install.sh set PROVIDER to a value not in hermes's registry. Run 'hermes doctor' on the workspace to see valid values. Raw: $AGENT_TEXT"
fi
# "Invalid API key" — the comment block lists this as a CP #238 race
# (tenant auth chain) signal but the grep was missing. Caller-side
# 401's containing this exact phrase don't match the generic
# "error|exception" catch-all below, so they'd slip through.
if echo "$AGENT_TEXT" | grep -qF "Invalid API key"; then
fail "A2A — REGRESSION: tenant auth chain returned 'Invalid API key'. Likely CP boot-event 401 race (CP #238) or stale OPENAI_API_KEY in the runtime env. Raw: $AGENT_TEXT"
fi
# Generic catch-all — falls through if none of the known regressions hit.
if echo "$AGENT_TEXT" | grep -qiE "error|exception"; then
fail "A2A returned an error-shaped response: $AGENT_TEXT"