Several AI e2e test apps repeat the same OpenRouter setup: read E2E_OPENROUTER_API_KEY, throw if it is missing, and call createOpenRouter({ apiKey }).
Apps with this code:
node-eve/agent/agent.ts
cloudflare-mastra/src/mastra/agents/weather-agent.ts
cloudflare-think/src/think-agent.ts
gen-ai-libraries/src/libraries.ts
node-mastra now has one shared src/mastra/openrouter.ts for all its scenarios. Do the same in the other apps, so that each app creates its OpenRouter client in one place. Each e2e app is a separate package, so the scope is one helper per app, unless a shared helper in @sentry-internal/test-utils is a good fit. The Cloudflare apps read the key from env per request, so a shared helper must take the key as an argument.
Follow-up from review: PR #25115 review comment
Several AI e2e test apps repeat the same OpenRouter setup: read
E2E_OPENROUTER_API_KEY, throw if it is missing, and callcreateOpenRouter({ apiKey }).Apps with this code:
node-eve/agent/agent.tscloudflare-mastra/src/mastra/agents/weather-agent.tscloudflare-think/src/think-agent.tsgen-ai-libraries/src/libraries.tsnode-mastranow has one sharedsrc/mastra/openrouter.tsfor all its scenarios. Do the same in the other apps, so that each app creates its OpenRouter client in one place. Each e2e app is a separate package, so the scope is one helper per app, unless a shared helper in@sentry-internal/test-utilsis a good fit. The Cloudflare apps read the key fromenvper request, so a shared helper must take the key as an argument.Follow-up from review: PR #25115 review comment