feat(providers): add xAI to hosted key rotation pool#5574
Conversation
Wires xai into the same hosted-key mechanism as OpenAI, Anthropic, and Z.ai so Sim can serve Grok models without users bringing their own key.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Hosted: BYOK: Tests cover rotation, hosted-model lists, billing eligibility, Pi cloud BYOK fallback, and the xAI provider definition. Reviewed by Cursor Bugbot for commit dfc0868. Configure here. |
Greptile SummaryThis PR adds xAI/Grok support to the hosted key and BYOK paths. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (3): Last reviewed commit: "fix(byok): add xai settings UI row" | Re-trigger Greptile |
xai was fully wired as a Pi-supported provider but missing from WORKSPACE_BYOK_PROVIDERS, so a stored workspace xAI key was never read back for cloud-mode Pi runs.
|
@cursor review |
xai is both hosted (Pi block hides its inline API key field for hosted models) and Pi-supported (cloud mode requires a user key), so without a Settings > BYOK row users had no way to supply an xai key for Pi cloud runs.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit dfc0868. Configure here.
Summary
XAI_API_KEY_1/2/3env vars +getRotatingApiKey('xai')rotation poolxaiadded togetHostedModels()so Grok models are billed/served with Sim's key when no BYOK key is setxaiadded toBYOKProviderIdunion +byokProviderIdSchema(workspace BYOK still works, no UI settings row added — same aszai, which is hosted-only today)Type of Change
Testing
bun run check:api-validationpassesbunx tsc --noEmitclean on touched files (2 pre-existing unrelated errors elsewhere on staging)bunx vitest run lib/core/utils.test.ts providers/models.test.ts lib/api-key/byok.test.ts providers/utils.test.ts— 222/222 passingbun run lintcleanChecklist