feat(script): migrate agent/router/evaluator LLM keys to BYOK by model prefix#5607
feat(script): migrate agent/router/evaluator LLM keys to BYOK by model prefix#5607TheodoreSpeaks wants to merge 5 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview Adds optional Reviewed by Cursor Bugbot for commit 5cee10c. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThis PR adds model-aware BYOK migration for shared LLM block credentials. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (5): Last reviewed commit: "fix(script): resolve overlapping model p..." | Re-trigger Greptile |
|
|
||
| // LLM-family blocks share one model-gated `apiKey` subblock across every provider, so the | ||
| // key is only attributed to a provider when the block's selected `model` matches a prefix. | ||
| const LLM_FAMILY_BLOCK_TYPES = ['agent', 'router', 'evaluator'] as const |
There was a problem hiding this comment.
@TheodoreSpeaks what about translate, I know we deprecated vision? and idk if there are more or not
There was a problem hiding this comment.
Good catch — added `translate` and `guardrails` (both use `getModelOptions()` + the shared `getProviderCredentialSubBlocks()` apiKey, same as agent/router/evaluator, so they can hold a grok key). Left `vision` out on purpose: it is deprecated and its curated `VISION_MODEL_OPTIONS` list has no grok models, so it can never hold an xai key. The set is now ['agent','router','evaluator','translate','guardrails'].
…er ids, reject mixed mapping, add key-prefix guard
|
Addressed the review feedback in
@greptile review |
|
Round 2 addressed in
@greptile review |
|
Round 3 addressed in
@greptile review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 02f0632. Configure here.
…ngest match wins)
|
Latest re-review triage (HEAD is now
@greptile review |

Summary
--model-map <modelPrefix>=<providerId>, e.g.grok=xai)agent/router/evaluatorblocks migrate to workspace BYOK, so they keep using their own key instead of falling back to the rotating key once the provider joins the hosted poolWhy 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. The new--model-maponly takes the key when the block's selectedmodelstarts with the given 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