Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(ui): keep oauth-broker providers off the LLM secrets picker

Alfredo Lopezb488f04b8c07
diff --git a/control-ui/components/LlmCredentialFields/index.tsx b/control-ui/components/LlmCredentialFields/index.tsx
index f328a8a39..eb7638cb4 100644
--- a/control-ui/components/LlmCredentialFields/index.tsx
+++ b/control-ui/components/LlmCredentialFields/index.tsx
@@ -11,6 +11,7 @@ import { Button, Field, TextAreaInput, TextInput } from '@/components/ui'
import { cn } from '@/lib/cn'
import {
LLM_CREDENTIAL_GROUPS,
+ LLM_SECRET_EDITOR_GROUPS,
type LlmCredentialGroup,
type LlmProvider,
getLlmGroupCompleteness,
@@ -137,8 +138,12 @@ export function LlmCredentialFields({
// Filtering LLM_CREDENTIAL_GROUPS (instead of iterating the sets) keeps the
// canonical package order regardless of the order providers were added.
- const visibleGroups = LLM_CREDENTIAL_GROUPS.filter(group => visibleProviders.has(group.provider))
- const addableGroups = LLM_CREDENTIAL_GROUPS.filter(group => !visibleProviders.has(group.provider))
+ const visibleGroups = LLM_SECRET_EDITOR_GROUPS.filter(group =>
+ visibleProviders.has(group.provider)
+ )
+ const addableGroups = LLM_SECRET_EDITOR_GROUPS.filter(
+ group => !visibleProviders.has(group.provider)
+ )
// The picker is a MENU, not a selection: it never holds a value (see the
// `value={[]}` below), so each addable provider is just an entry with its
@@ -288,7 +293,7 @@ export function LlmCredentialFields({
}
function addProvider(value: string) {
- const group = LLM_CREDENTIAL_GROUPS.find(item => item.provider === value)
+ const group = LLM_SECRET_EDITOR_GROUPS.find(item => item.provider === value)
if (!group) return
setManuallyAdded(prev => new Set(prev).add(group.provider))
}
diff --git a/control-ui/components/__tests__/LlmCredentialFields.test.tsx b/control-ui/components/__tests__/LlmCredentialFields.test.tsx
index c59221a7d..c425a4b4f 100644
--- a/control-ui/components/__tests__/LlmCredentialFields.test.tsx
+++ b/control-ui/components/__tests__/LlmCredentialFields.test.tsx
@@ -1,7 +1,7 @@
import { useState } from 'react'
import { afterEach, describe, expect, it, vi } from 'vitest'
import { cleanup, fireEvent, render, screen, within } from '@testing-library/react'
-import { LLM_CREDENTIAL_GROUPS, providerForDataKey } from '@/lib/llm'
+import { LLM_CREDENTIAL_GROUPS, LLM_SECRET_EDITOR_GROUPS, providerForDataKey } from '@/lib/llm'
import { LlmCredentialFields } from '../LlmCredentialFields'
afterEach(cleanup)
@@ -65,13 +65,16 @@ describe('LlmCredentialFields (additive provider editor)', () => {
const { container } = render(<Harness />)
expect(container.querySelectorAll('.cu-llm-cred-group')).toHaveLength(0)
expect(screen.getByText(/No providers added yet/i)).toBeInTheDocument()
- // One option per provider in the shared package (the dropdown has no
- // placeholder entry — the placeholder lives on the trigger button).
+ // One option per Secret-backed provider (oauth-broker stays off this form).
+ // The dropdown has no placeholder entry — the placeholder lives on the trigger.
openAddProvider()
const options = screen.getAllByRole('option')
- expect(options).toHaveLength(LLM_CREDENTIAL_GROUPS.length)
+ expect(options).toHaveLength(LLM_SECRET_EDITOR_GROUPS.length)
+ expect(
+ options.some(option => option.querySelector('[data-provider="codex-subscription"]'))
+ ).toBe(false)
// Every entry carries its provider brand mark, keyed to the provider id.
- for (const group of LLM_CREDENTIAL_GROUPS) {
+ for (const group of LLM_SECRET_EDITOR_GROUPS) {
const option = screen.getByRole('option', { name: group.label })
expect(
option.querySelector(`.cu-llm-provider-icon[data-provider="${group.provider}"]`)
@@ -98,11 +101,11 @@ describe('LlmCredentialFields (additive provider editor)', () => {
expect(sectionTitle('Anthropic')).toBeNull()
})
- it('hides the picker once every provider is visible', () => {
+ it('hides the picker once every Secret-backed provider is visible', () => {
render(<Harness />)
- for (const group of LLM_CREDENTIAL_GROUPS) addProvider(group.provider)
+ for (const group of LLM_SECRET_EDITOR_GROUPS) addProvider(group.provider)
expect(screen.queryByLabelText('Add provider')).toBeNull()
- })
+ }, 15_000)
it('renders the Bedrock access-key pair and the Vertex JSON textarea when added', () => {
render(<Harness />)
diff --git a/control-ui/lib/__tests__/llm.test.ts b/control-ui/lib/__tests__/llm.test.ts
index acd0dc983..72e29f435 100644
--- a/control-ui/lib/__tests__/llm.test.ts
+++ b/control-ui/lib/__tests__/llm.test.ts
@@ -4,6 +4,7 @@ import {
BEDROCK_CREDENTIAL_KEYS,
LLM_CREDENTIAL_GROUPS,
LLM_DEFAULT_MODEL_BY_PROVIDER,
+ LLM_SECRET_EDITOR_GROUPS,
type LlmModelCatalogEntry,
OPERATOR_PROVIDER_OPTIONS,
brokerBackedRecipeAuthoringError,
@@ -191,6 +192,13 @@ describe('LLM_CREDENTIAL_GROUPS (spec R4.5.1/R4.5.2)', () => {
expect(LLM_DEFAULT_MODEL_BY_PROVIDER['codex-subscription']).toBeUndefined()
expect(resolveDefaultModel('codex-subscription', ['gpt-5.1'])).toBe('')
})
+
+ it('keeps oauth-broker providers off the Kubernetes Secret editor list', () => {
+ expect(LLM_SECRET_EDITOR_GROUPS.some(group => group.provider === 'codex-subscription')).toBe(
+ false
+ )
+ expect(LLM_SECRET_EDITOR_GROUPS.every(group => group.slots.length > 0)).toBe(true)
+ })
})
describe('getLlmGroupCompleteness (spec R4.5.5)', () => {
diff --git a/control-ui/lib/llm.ts b/control-ui/lib/llm.ts
index 45bda62fe..fd190e5e1 100644
--- a/control-ui/lib/llm.ts
+++ b/control-ui/lib/llm.ts
@@ -239,6 +239,12 @@ export function providerRequiresLlmSecret(provider: string): boolean {
return isLlmProviderId(provider) && PROVIDER_AUTH_MODE[provider] === 'static-credentials'
}
+// Secrets editor: only providers that store Kubernetes Secret slots. OAuth
+// brokers (Codex) connect on their own page and must not appear in the picker.
+export const LLM_SECRET_EDITOR_GROUPS: LlmCredentialGroup[] = LLM_CREDENTIAL_GROUPS.filter(group =>
+ providerRequiresLlmSecret(group.provider)
+)
+
// A Host/recipe LLM chain needs a Secret iff any target (primary or fallback)
// uses static credentials. Codex-only chains save without `secretRef`.
export function llmChainRequiresSecret(
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index cb12f538b..e1f64bb94 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.447",
+ "version": "0.1.448",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.447",
+ "version": "0.1.448",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/llm-providers": "file:../packages/llm-providers",
diff --git a/control-ui/package.json b/control-ui/package.json
index a389c6693..b9acd05fc 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.447",
+ "version": "0.1.448",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",