From 11fe32f4c6d60d479fdea665bb60fc17e16b0491 Mon Sep 17 00:00:00 2001 From: Michael Chihlas Date: Sun, 26 Apr 2026 00:51:39 -0400 Subject: [PATCH] fix(ci): set stub ANTHROPIC_API_KEY for e2e job so AI-gated endpoints respond MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit POST /api/v1/ai-sessions and friends call _require_ai_enabled(), which returns 503 when no provider key is set. The new prefill-handoff regression test (e2e/assistant-chat-prefill.spec.ts) drives the dashboard prefill flow, which has to create a chat session before its page.route stub on /chat can fire — so without a key, session creation 503s and the test never sees the task lane. The Playwright stub intercepts /chat in the browser, so the backend never actually contacts Anthropic — but the AI-enabled gate still needs to pass. A stub value is enough. Co-Authored-By: Claude Opus 4.7 --- .gitea/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index d3f2f8c9..d87bdacc 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -161,6 +161,12 @@ jobs: PLAYWRIGHT_SECRET_KEY: ci-playwright-secret-key PLAYWRIGHT_TEST_EMAIL: teamadmin@resolutionflow.example.com PLAYWRIGHT_TEST_PASSWORD: TestPass123! + # AI-touching endpoints (POST /ai-sessions, /chat, /respond, etc.) are + # gated by `_require_ai_enabled()`, which returns 503 when no provider + # key is set. Tests that exercise those flows stub the AI calls in the + # browser via `page.route`, so the backend never actually contacts + # Anthropic — but the gate still has to pass. A stub value is enough. + ANTHROPIC_API_KEY: ci-stub-key-not-used-by-tests steps: - uses: actions/checkout@v4