fix(studio): fallback to env variable to detect ai feature#3713
fix(studio): fallback to env variable to detect ai feature#3713
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
📝 WalkthroughWalkthroughThis change modifies the Studio API key initialization in Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/utils/studio.ts`:
- Around line 32-35: The code uses logical OR when deriving apiKey which causes
an explicitly configured empty studioAIConfig.apiKey to be overridden by
process.env.AI_GATEWAY_API_KEY; change the assignment for apiKey to use nullish
coalescing so an empty string remains respected (i.e., pick
studioAIConfig.apiKey unless it is null or undefined, otherwise fall back to
process.env.AI_GATEWAY_API_KEY) and leave the existing (!apiKey) return check
as-is; update the expression where apiKey is set (refer to the studioAIConfig
and apiKey variables) accordingly.
🔗 Linked issue
❓ Type of change
📚 Description
📝 Checklist