feat: make model selection optional when creating virtual keys

- Remove required validation for models field in create_key_button.tsx
- Update help text to clarify models are optional
- If no models selected, key will have access to all models
- This allows users to create keys for MCP-only access without selecting LLM models
- Fixes LIT-1791: Cannot create virtual key without LLM provider if user only has MCP access

Backend already supports empty models list (defaults to all models).
This change only updates the UI source to match backend behavior.

Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>
This commit is contained in:
Cursor Agent 2026-03-05 01:15:41 +00:00
parent b7f43d411a
commit 6d8ece5802

View file

@ -772,21 +772,17 @@ const CreateKey: React.FC<CreateKeyProps> = ({ team, teams, data, addKey }) => {
label={
<span>
Models{" "}
<Tooltip title="Select which models this key can access. Choose 'All Team Models' to grant access to all models available to the team">
<Tooltip title="Select which models this key can access. Choose 'All Team Models' to grant access to all models available to the team. Leave empty to allow access to all models.">
<InfoCircleOutlined style={{ marginLeft: "4px" }} />
</Tooltip>
</span>
}
name="models"
rules={
keyType === "management" || keyType === "read_only"
? []
: [{ required: true, message: "Please select a model" }]
}
rules={[]}
help={
keyType === "management" || keyType === "read_only"
? "Models field is disabled for this key type"
: "required"
: "optional - leave empty to allow access to all models"
}
className="mt-4"
>