feat(providers): xAI hosted keys + BYOK migration#5603
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.
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.
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview BYOK resolution prefers workspace keys for hosted xAI models, then falls back to rotating server keys when no BYOK is stored. The block→BYOK migration script gains Reviewed by Cursor Bugbot for commit 91fcf75. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThis PR adds xAI support to hosted keys and BYOK migration paths.
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (1): Last reviewed commit: "feat(byok): migrate agent/router/evaluat..." | Re-trigger Greptile |
Summary
--model-map grok=xai) so existing grok keys entered intoagent/router/evaluatorblocks migrate to workspace BYOK instead of falling back to the rotating key post-launchWhy the migration needed a new mode
The existing
--map <blockType>=<providerId>only works for dedicated single-provider blocks. LLM-family blocks (agent,router,evaluator) share one model-gatedapiKeysubblock across every provider, so a block-type map would misattribute every provider's key as xai. The new--model-map <modelPrefix>=<providerId>only takes the key when the block's selectedmodelmatches the prefix.Type of Change
Testing
iv:encrypted:authTag),created_byset, one key per workspace with full coverage of eligible blocksbun run check:api-validation:strictpassedChecklist