Skip to content

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

TypeScript

fix: hide empty connector auth labels and stabilize CI tests

Josué6b960f89ecb2
diff --git a/control-ui/app/hosts/[name]/page.tsx b/control-ui/app/hosts/[name]/page.tsx
index 0fd3d912e..882096e1b 100644
--- a/control-ui/app/hosts/[name]/page.tsx
+++ b/control-ui/app/hosts/[name]/page.tsx
@@ -1674,11 +1674,13 @@ export default function HostDetailsPage() {
<span className="cu-table__cell-name">{server}</span>
</td>
<td>
- <span className="cu-connector-badge">
- {connectorCatalogLoading
- ? 'Loading…'
- : (connectorAuthenticationByName[server] ?? 'Unknown')}
- </span>
+ {connectorCatalogLoading ? (
+ <span className="cu-connector-badge">Loading…</span>
+ ) : connectorAuthenticationByName[server] === '' ? null : (
+ <span className="cu-connector-badge">
+ {connectorAuthenticationByName[server] ?? 'Unknown'}
+ </span>
+ )}
</td>
<td className="cu-table__cell-actions">
<div className="cu-table-actions">
diff --git a/control-ui/components/McpServerTable.tsx b/control-ui/components/McpServerTable.tsx
index 413e80696..a5efae172 100644
--- a/control-ui/components/McpServerTable.tsx
+++ b/control-ui/components/McpServerTable.tsx
@@ -89,7 +89,8 @@ function StatusBadge({ status }: { status?: McpServerStatus }) {
}
function AuthenticationBadge({ authType }: { authType: unknown }) {
- return <span className="cu-connector-badge">{connectorAuthenticationLabel(authType)}</span>
+ const label = connectorAuthenticationLabel(authType)
+ return label ? <span className="cu-connector-badge">{label}</span> : null
}
export function McpServerTable({
diff --git a/control-ui/components/__tests__/HostDetailsPage.connectors.test.tsx b/control-ui/components/__tests__/HostDetailsPage.connectors.test.tsx
index a87c734ed..c5cbfd7c3 100644
--- a/control-ui/components/__tests__/HostDetailsPage.connectors.test.tsx
+++ b/control-ui/components/__tests__/HostDetailsPage.connectors.test.tsx
@@ -301,8 +301,15 @@ describe('HostDetailsPage connectors', () => {
cleanup()
activeHostName = 'foo'
+ vi.mocked(api.getMcpServers).mockClear()
renderPage()
expect(await screen.findByText('mcp-existing')).toBeInTheDocument()
+ await waitFor(() => expect(api.getMcpServers).toHaveBeenCalledTimes(1))
+ const connectorRow = screen.getByText('mcp-existing').closest('tr')
+ const authenticationCell = connectorRow?.querySelector('td:nth-child(2)')
+ expect(authenticationCell).not.toBeNull()
+ await waitFor(() => expect(authenticationCell?.textContent?.trim()).toBe(''))
+ expect(authenticationCell?.childElementCount).toBe(0)
fireEvent.click(screen.getByRole('button', { name: 'Add connector' }))
await waitFor(() => expect(api.getMcpServers).toHaveBeenCalledTimes(1))
fireEvent.click(await screen.findByRole('checkbox', { name: 'mcp-new' }))
diff --git a/control-ui/components/__tests__/HostDetailsPage.rateLimit.test.tsx b/control-ui/components/__tests__/HostDetailsPage.rateLimit.test.tsx
index 915e31db7..531dc4e96 100644
--- a/control-ui/components/__tests__/HostDetailsPage.rateLimit.test.tsx
+++ b/control-ui/components/__tests__/HostDetailsPage.rateLimit.test.tsx
@@ -56,6 +56,7 @@ vi.mock('../../lib/api', async importOriginal => {
getHostDetailBundle: vi.fn(),
getHost: vi.fn(),
getLlmModels: vi.fn(),
+ getMcpServers: vi.fn(),
apiSend: vi.fn(),
}
})
@@ -177,6 +178,9 @@ describe('HostDetailsPage optional subscription throttling', () => {
updated_at: '',
})),
})
+ // This suite tracks only subscription metadata GETs. Connector details use
+ // the API client directly and are outside that rate-limit contract.
+ vi.mocked(api.getMcpServers).mockResolvedValue({ items: [] } as never)
fetchMock = vi.fn((input: RequestInfo | URL) => {
if (String(input).endsWith('/capabilities'))
return Promise.resolve(
diff --git a/control-ui/components/__tests__/McpServerTable.test.tsx b/control-ui/components/__tests__/McpServerTable.test.tsx
index 6cda11931..30261c2a9 100644
--- a/control-ui/components/__tests__/McpServerTable.test.tsx
+++ b/control-ui/components/__tests__/McpServerTable.test.tsx
@@ -20,6 +20,7 @@ function makeItem(overrides: {
image?: string
contextRef?: string
description?: string
+ authType?: string | null
transportType?: 'sse' | 'streamableHttp' | 'stdio'
enabled?: boolean
conditions?: McpServerCondition[] | undefined
@@ -31,6 +32,7 @@ function makeItem(overrides: {
image: string
contextRef: string
description?: string
+ auth?: { type?: string | null } | null
enabled?: boolean
transport: { type: 'sse' | 'streamableHttp' | 'stdio'; url: string }
}
@@ -44,6 +46,9 @@ function makeItem(overrides: {
image: overrides.image ?? 'ghcr.io/example/mcp:1.0',
contextRef: overrides.contextRef ?? 'context1',
description: overrides.description,
+ ...(overrides.authType === undefined
+ ? {}
+ : { auth: overrides.authType === null ? null : { type: overrides.authType } }),
enabled: overrides.enabled,
transport: {
type: overrides.transportType ?? 'streamableHttp',
@@ -237,6 +242,32 @@ describe('McpServerTable — marketplace-aligned rows', () => {
})
describe('McpServerTable — connector list', () => {
+ it('leaves authentication blank without a configured type and labels configured types', () => {
+ render(
+ <McpServerTable
+ items={[
+ makeItem({ name: 'public-connector' }),
+ makeItem({ name: 'none-connector', authType: 'none' }),
+ makeItem({ name: 'null-connector', authType: null }),
+ makeItem({ name: 'oauth-connector', authType: 'oauth' }),
+ makeItem({ name: 'static-connector', authType: 'bearer' }),
+ ]}
+ />
+ )
+
+ for (const name of ['public-connector', 'none-connector', 'null-connector']) {
+ const row = screen.getByText(name).closest('tr')
+ const authenticationCell = row?.querySelector('td:nth-child(3)')
+ expect(authenticationCell?.textContent?.trim()).toBe('')
+ expect(authenticationCell?.childElementCount).toBe(0)
+ }
+ expect(screen.getByText('oauth-connector').closest('tr')).toHaveTextContent('OAuth')
+ expect(screen.getByText('static-connector').closest('tr')).toHaveTextContent(
+ 'Static credentials'
+ )
+ expect(screen.queryByText('No authentication')).toBeNull()
+ })
+
it('renders ordinary rows without inline detail expansion', () => {
const items = [makeItem({ name: 'airtable-server' })]
render(<McpServerTable items={items} />)
diff --git a/control-ui/lib/connectorAuthentication.ts b/control-ui/lib/connectorAuthentication.ts
index 591bc3cd9..2c34de9cc 100644
--- a/control-ui/lib/connectorAuthentication.ts
+++ b/control-ui/lib/connectorAuthentication.ts
@@ -5,6 +5,6 @@ export function connectorAuthenticationLabel(authType: unknown): string {
if (typeof authType === 'string' && STATIC_AUTH_TYPES.has(authType)) {
return 'Static credentials'
}
- if (authType == null || authType === 'none') return 'No authentication'
+ if (authType == null || authType === 'none') return ''
return 'Other'
}
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index 89df19642..191082cb1 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.729",
+ "version": "0.1.730",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.729",
+ "version": "0.1.730",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/frontend-components": "file:../packages/frontend-components",
diff --git a/control-ui/package.json b/control-ui/package.json
index a23f3ab42..86b2a5f69 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.729",
+ "version": "0.1.730",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",
diff --git a/desktop-app/ui/src/lib/connectorPresentation.ts b/desktop-app/ui/src/lib/connectorPresentation.ts
index 92bcc326c..2fcb91b18 100644
--- a/desktop-app/ui/src/lib/connectorPresentation.ts
+++ b/desktop-app/ui/src/lib/connectorPresentation.ts
@@ -28,7 +28,7 @@ export function authenticationLabel(connector: Pick<RpcConnector, 'authKind'>):
if (connector.authKind === 'oauth-user' || connector.authKind === 'oauth-context') {
return 'OAuth'
}
- return connector.authKind === 'static' ? 'Static credentials' : 'No authentication'
+ return connector.authKind === 'static' ? 'Static credentials' : ''
}
export function connectorScopeLabel(connector: RpcConnector): string {
diff --git a/desktop-app/ui/src/pages/McpServersPage.tsx b/desktop-app/ui/src/pages/McpServersPage.tsx
index 7d2a4b42e..6e423bd4c 100644
--- a/desktop-app/ui/src/pages/McpServersPage.tsx
+++ b/desktop-app/ui/src/pages/McpServersPage.tsx
@@ -89,9 +89,11 @@ function ConnectorRowView({
</td>
<td className="da-table__cell">
- <Pill tone="neutral" size="sm">
- {authentication}
- </Pill>
+ {authentication ? (
+ <Pill tone="neutral" size="sm">
+ {authentication}
+ </Pill>
+ ) : null}
</td>
<td className="da-table__cell">
diff --git a/desktop-app/ui/src/pages/__tests__/McpServersPage.test.tsx b/desktop-app/ui/src/pages/__tests__/McpServersPage.test.tsx
index 0cf5c2bf9..afd6aea22 100644
--- a/desktop-app/ui/src/pages/__tests__/McpServersPage.test.tsx
+++ b/desktop-app/ui/src/pages/__tests__/McpServersPage.test.tsx
@@ -45,6 +45,7 @@ const CONNECTORS: RpcConnectorsResult = {
status: 'requires_setup',
},
{ name: 'filesystem', authKind: 'static', status: 'no_oauth' },
+ { name: 'public-data', status: 'no_oauth' },
{
name: 'shared-drive',
provider: 'google',
@@ -236,6 +237,15 @@ describe('McpServersPage — da-table layout + navigation', () => {
const filesystem = rowBy(rows, 'filesystem', 'agent-zeta')
expect(chipText(filesystem)).toBe('—')
expect(buttonLabels(filesystem)).toEqual([])
+ expect(filesystem.querySelector('td:nth-child(4)')?.textContent?.trim()).toBe(
+ 'Static credentials'
+ )
+
+ const publicData = rowBy(rows, 'public-data', 'agent-zeta')
+ const authenticationCell = publicData.querySelector('td:nth-child(4)')
+ expect(authenticationCell?.textContent?.trim()).toBe('')
+ expect(authenticationCell?.childElementCount).toBe(0)
+ expect(publicData.textContent).not.toContain('No authentication')
// oauth-user scope pill surfaces the blast-radius caption as a tooltip.
expect(monday.querySelector('.ui-pill')?.getAttribute('title')).toMatch(