Skip to content

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

TypeScript

feat(control-ui): manage agent connectors

Miguelon Peluchon6f781a14efaf
diff --git a/control-ui/app/hosts/[name]/page.tsx b/control-ui/app/hosts/[name]/page.tsx
index 2ca0ebbd0..001387cce 100644
--- a/control-ui/app/hosts/[name]/page.tsx
+++ b/control-ui/app/hosts/[name]/page.tsx
@@ -4,6 +4,7 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { useParams, useRouter } from 'next/navigation'
import { useConfirmDialog } from '@components/ConfirmDialog'
import { DetailPageShell } from '@components/DetailPageShell'
+import { SelectionDropdown } from '@components/SelectionDropdown'
import { useToast } from '@components/Toast'
import { HOST_DEFAULT_TAB, HOST_TABS } from '@constants/hostDetails'
import { CONTROL_ROUTES } from '@constants/routes'
@@ -16,7 +17,15 @@ import { HostOverviewTab } from '../../../components/HostOverviewTab'
import { LlmProviderConfig } from '../../../components/LlmProviderConfig'
import { IconRobot } from '../../../components/Sidebar/icons'
import { IconCheck, IconMoreHorizontal, IconPencil, IconX } from '../../../components/icons'
-import { apiSend, getHost, getHostDetailBundle } from '../../../lib/api'
+import {
+ apiSend,
+ getHost,
+ getHostDetailBundle,
+ getMcpServers,
+ updateContext,
+} from '../../../lib/api'
+import type { ContextResource, ContextSpec } from '../../../lib/api'
+import { buildContextUpdatePayload, contextMutationError } from '../../../lib/contextMutation'
import { useLlmAllowedModels } from '../../../lib/hooks/useLlmAllowedModels'
import { FIRST_PARTY_CHANNEL_WORKFLOW_CONTROL_SCOPES } from '../../../lib/hostWorkflowControl'
import {
@@ -87,6 +96,32 @@ function friendlyLifecycleReason(reason: string): string {
return reason
}
+function contextResourceName(context: ContextResource | null): string {
+ return String(context?.metadata?.name || context?.spec?.contextId || '').trim()
+}
+
+function normalizeConnectorNames(value: unknown): string[] {
+ if (!Array.isArray(value)) return []
+ return Array.from(
+ new Set(
+ value
+ .map(String)
+ .map(name => name.trim())
+ .filter(Boolean)
+ )
+ )
+}
+
+function agentConnectorMutationError(error: unknown): string {
+ if ((error as { status?: unknown } | null)?.status === 409) {
+ return 'This agent’s connectors changed since they were loaded. Reload the agent and try again.'
+ }
+ if (error instanceof Error && /context version is unavailable/i.test(error.message)) {
+ return 'This agent’s connector settings are missing a server version. Reload the agent and try again.'
+ }
+ return contextMutationError(error, 'Failed to update connectors for this agent.')
+}
+
function AgentActionsMenu({ busy, onDelete }: { busy: boolean; onDelete: () => void }) {
const [open, setOpen] = useState(false)
const ref = useRef<HTMLDivElement>(null)
@@ -217,6 +252,15 @@ export default function HostDetailsPage() {
const [guardrailsData, setGuardrailsData] = useState<HostGuardrails | undefined>(undefined)
// Overview tab — read-only summary. Kept in sync with the host spec by loadData.
const [contextMcpServers, setContextMcpServers] = useState<string[]>([])
+ // The agent's private connector context is an implementation detail. Keep the
+ // full resource locally so connector writes can preserve additive spec fields
+ // and carry the resourceVersion without exposing the context in the UI.
+ const [agentContext, setAgentContext] = useState<ContextResource | null>(null)
+ const [availableConnectorNames, setAvailableConnectorNames] = useState<string[]>([])
+ const [connectorCatalogLoaded, setConnectorCatalogLoaded] = useState(false)
+ const [connectorCatalogLoading, setConnectorCatalogLoading] = useState(false)
+ const [showAddConnector, setShowAddConnector] = useState(false)
+ const [selectedConnectorNames, setSelectedConnectorNames] = useState<string[]>([])
const [hostStatusLabel, setHostStatusLabel] = useState('Unknown')
const [hostStatusTone, setHostStatusTone] = useState<'active' | 'inactive' | 'unknown'>('unknown')
const [hostCreatedAt, setHostCreatedAt] = useState('')
@@ -330,17 +374,10 @@ export default function HostDetailsPage() {
// Overview read-only summary: linked context's MCP servers + access counts.
const ref = overview.contextRef.trim()
const matched = (contextsList || []).find(
- (item: { spec?: { contextId?: string }; metadata?: { name?: string } }) =>
- String(item.spec?.contextId || item.metadata?.name || '').trim() === ref
- )
- const servers = Array.isArray(
- (matched as { spec?: { mcpServers?: unknown[] } } | undefined)?.spec?.mcpServers
- )
- ? ((matched as { spec?: { mcpServers?: unknown[] } }).spec!.mcpServers as unknown[])
- .map(String)
- .map(v => v.trim())
- .filter(Boolean)
- : []
+ item => String(item.spec?.contextId || item.metadata?.name || '').trim() === ref
+ ) as ContextResource | undefined
+ setAgentContext(matched ?? null)
+ const servers = normalizeConnectorNames(matched?.spec?.mcpServers)
setContextMcpServers(servers)
setAccessSummary({
memberCount: Array.isArray(agentUsers) ? agentUsers.length : 0,
@@ -464,11 +501,106 @@ export default function HostDetailsPage() {
void loadData()
}, [routeName])
+ async function openAddConnectorDialog() {
+ setSelectedConnectorNames([])
+ setShowAddConnector(true)
+ setError('')
+ if (connectorCatalogLoaded || connectorCatalogLoading) return
+
+ setConnectorCatalogLoading(true)
+ try {
+ const response = await getMcpServers()
+ const names = (response.items || [])
+ .map(item => String(item.metadata?.name || '').trim())
+ .filter(Boolean)
+ .sort((a, b) => a.localeCompare(b))
+ setAvailableConnectorNames(Array.from(new Set(names)))
+ setConnectorCatalogLoaded(true)
+ } catch (e) {
+ setError(e instanceof Error ? e.message : 'Failed to load available connectors.')
+ } finally {
+ setConnectorCatalogLoading(false)
+ }
+ }
+
+ async function saveAgentConnectors(nextServers: string[]): Promise<boolean> {
+ const contextName = contextResourceName(agentContext)
+ const contextVersion = agentContext?.metadata?.resourceVersion
+ if (!contextName) {
+ setError(
+ 'Connector settings are not available for this agent yet. Reload the agent and try again.'
+ )
+ return false
+ }
+
+ const normalizedServers = normalizeConnectorNames(nextServers)
+ const currentSpec = (agentContext?.spec || {}) as Record<string, unknown>
+ const contextId = String(currentSpec.contextId || contextName).trim()
+ if (!contextId) {
+ setError(
+ 'Connector settings are not available for this agent yet. Reload the agent and try again.'
+ )
+ return false
+ }
+
+ setBusy(true)
+ setError('')
+ try {
+ const updated = await updateContext(
+ contextName,
+ buildContextUpdatePayload(contextVersion, {
+ ...currentSpec,
+ contextId,
+ mcpServers: normalizedServers,
+ } as ContextSpec)
+ )
+ const updatedContext: ContextResource = {
+ ...agentContext,
+ ...updated,
+ metadata: { ...agentContext.metadata, ...(updated?.metadata || {}) },
+ spec: {
+ ...agentContext.spec,
+ ...(updated?.spec || {}),
+ contextId,
+ mcpServers: normalizedServers,
+ },
+ }
+ setAgentContext(updatedContext)
+ setContextMcpServers(normalizedServers)
+ showToast('Connectors updated.', { tone: 'success' })
+ return true
+ } catch (e) {
+ setError(agentConnectorMutationError(e))
+ return false
+ } finally {
+ setBusy(false)
+ }
+ }
+
+ async function removeAgentConnector(server: string) {
+ const shouldRemove = await confirm({
+ title: 'Remove connector from this agent?',
+ message: `Remove ${server} from ${routeName}?`,
+ confirmLabel: 'Remove connector',
+ tone: 'danger',
+ })
+ if (!shouldRemove) return
+ await saveAgentConnectors(contextMcpServers.filter(item => item !== server))
+ }
+
const currentSecretKeys = useMemo(
() => secretKeysByName[secretRefDraft] ?? [],
[secretKeysByName, secretRefDraft]
)
+ const connectorOptions = useMemo(
+ () =>
+ availableConnectorNames
+ .filter(name => !contextMcpServers.includes(name))
+ .map(name => ({ value: name, label: name })),
+ [availableConnectorNames, contextMcpServers]
+ )
+
// Track fallback removals: when a fallback with its OWN stored extra slot is
// dropped and no remaining entry references that key, offer to retire it
// (spec Topic 1b R5). Re-adding a fallback that reclaims the key un-offers it.
@@ -1052,9 +1184,21 @@ export default function HostDetailsPage() {
{activeTab === 'contexts' && (
<>
- <p className="cu-muted" style={{ fontSize: '0.875rem', marginBottom: '1rem' }}>
- Connectors available to this agent.
- </p>
+ <div className="cu-agent-detail-heading">
+ <p className="cu-muted" style={{ fontSize: '0.875rem', margin: 0 }}>
+ Connectors available to this agent.
+ </p>
+ <div className="cu-agent-detail-heading__actions">
+ <button
+ type="button"
+ className="cu-btn cu-btn--primary cu-btn--sm"
+ onClick={() => void openAddConnectorDialog()}
+ disabled={busy || !agentContext}
+ >
+ Add connector
+ </button>
+ </div>
+ </div>
<div className="cu-table-wrap">
<table className="cu-table cu-table--header-band cu-table--static-rows">
<thead>
@@ -1073,9 +1217,7 @@ export default function HostDetailsPage() {
) : contextMcpServers.length === 0 ? (
<tr>
<td colSpan={2} className="cu-empty">
- {contextRefDraft.trim()
- ? 'No connectors attached to this context.'
- : 'No context selected.'}
+ No connectors attached yet.
</td>
</tr>
) : (
@@ -1085,7 +1227,16 @@ export default function HostDetailsPage() {
<span className="cu-table__cell-name">{server}</span>
</td>
<td className="cu-table__cell-actions">
- <span className="cu-table__cell-muted">—</span>
+ <button
+ type="button"
+ className="cu-btn cu-btn--icon cu-btn--danger-icon"
+ onClick={() => void removeAgentConnector(server)}
+ disabled={busy}
+ aria-label={`Remove connector ${server}`}
+ title="Remove connector"
+ >
+ <IconX width={16} height={16} />
+ </button>
</td>
</tr>
))
@@ -1096,6 +1247,105 @@ export default function HostDetailsPage() {
</>
)}
+ {showAddConnector && (
+ <div
+ className="cu-modal-backdrop"
+ role="presentation"
+ onMouseDown={event => {
+ if (event.target === event.currentTarget && !busy) {
+ setShowAddConnector(false)
+ setSelectedConnectorNames([])
+ }
+ }}
+ >
+ <section
+ className="cu-modal-panel cu-modal-panel--selection"
+ role="dialog"
+ aria-modal="true"
+ aria-labelledby="add-agent-connector-title"
+ onMouseDown={event => event.stopPropagation()}
+ >
+ <div className="cu-modal-panel__head">
+ <h3 id="add-agent-connector-title" className="cu-modal-panel__title">
+ Add connectors
+ </h3>
+ <button
+ type="button"
+ className="cu-btn cu-btn--icon cu-btn--ghost"
+ onClick={() => {
+ setShowAddConnector(false)
+ setSelectedConnectorNames([])
+ }}
+ disabled={busy}
+ aria-label="Close"
+ >
+ <IconX width={18} height={18} />
+ </button>
+ </div>
+
+ <p className="cu-modal-copy">
+ Select the connectors this agent can use. You can change this later.
+ </p>
+
+ {connectorCatalogLoading ? (
+ <div className="cu-empty">Loading available connectors…</div>
+ ) : (
+ <div className="cu-field">
+ <label htmlFor="agent-connector-picker">Connectors</label>
+ <SelectionDropdown
+ id="agent-connector-picker"
+ inline
+ value={selectedConnectorNames}
+ onChange={setSelectedConnectorNames}
+ options={connectorOptions}
+ placeholder="Select connectors"
+ searchPlaceholder="Search connectors..."
+ selectionLabel="Selected connectors"
+ emptyLabel="No additional connectors available."
+ disabled={busy}
+ />
+ </div>
+ )}
+
+ <div className="cu-modal-panel__foot">
+ <button
+ type="button"
+ className="cu-btn cu-btn--ghost cu-btn--sm"
+ onClick={() => {
+ setShowAddConnector(false)
+ setSelectedConnectorNames([])
+ }}
+ disabled={busy}
+ >
+ Cancel
+ </button>
+ <button
+ type="button"
+ className="cu-btn cu-btn--primary"
+ onClick={async () => {
+ const saved = await saveAgentConnectors([
+ ...contextMcpServers,
+ ...selectedConnectorNames,
+ ])
+ if (saved) {
+ setShowAddConnector(false)
+ setSelectedConnectorNames([])
+ }
+ }}
+ disabled={
+ busy ||
+ connectorCatalogLoading ||
+ selectedConnectorNames.length === 0 ||
+ !agentContext
+ }
+ >
+ {selectedConnectorNames.length > 1 ? 'Add connectors' : 'Add connector'}
+ </button>
+ </div>
+ </section>
+ </div>
+ )}
+
{activeTab === 'identity' && <HostIdentityTab hostName={routeName} />}
{activeTab === 'access' && <HostAccessTab hostName={routeName} />}
diff --git a/control-ui/components/HostOverviewTab/index.tsx b/control-ui/components/HostOverviewTab/index.tsx
index f17800b1e..b88b4f6fe 100644
--- a/control-ui/components/HostOverviewTab/index.tsx
+++ b/control-ui/components/HostOverviewTab/index.tsx
@@ -244,7 +244,7 @@ export function HostOverviewTab({
</ul>
) : (
<p className="cu-muted" style={{ margin: '0.5rem 0 0', fontSize: '0.875rem' }}>
- {hasContext ? 'No connectors attached.' : 'No context selected.'}
+ {hasContext ? 'No connectors attached.' : 'No connectors attached yet.'}
</p>
)}
</div>
diff --git a/control-ui/components/__tests__/HostDetailsPage.conflict.test.tsx b/control-ui/components/__tests__/HostDetailsPage.conflict.test.tsx
index 3dd0e049d..310e6660e 100644
--- a/control-ui/components/__tests__/HostDetailsPage.conflict.test.tsx
+++ b/control-ui/components/__tests__/HostDetailsPage.conflict.test.tsx
@@ -46,10 +46,12 @@ vi.mock('../../lib/api', () => ({
getAgentUsers: vi.fn(),
getHost: vi.fn(),
getHostDetailBundle: vi.fn(),
+ getMcpServers: vi.fn(),
getLlmModels: vi.fn().mockResolvedValue({ rows: [] }),
isSilentApiError: vi.fn().mockReturnValue(false),
updateAdminTeamAgents: vi.fn(),
updateAdminUserAgents: vi.fn(),
+ updateContext: vi.fn(),
}))
const baseSpec = {
diff --git a/control-ui/components/__tests__/HostDetailsPage.connectors.test.tsx b/control-ui/components/__tests__/HostDetailsPage.connectors.test.tsx
new file mode 100644
index 000000000..f6286cb3a
--- /dev/null
+++ b/control-ui/components/__tests__/HostDetailsPage.connectors.test.tsx
@@ -0,0 +1,155 @@
+import React from 'react'
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
+import { cleanup, fireEvent, render as rtlRender, screen, waitFor } from '@testing-library/react'
+import HostDetailsPage from '../../app/hosts/[name]/page'
+import * as api from '../../lib/api'
+import { ToastProvider } from '../Toast'
+
+const replaceMock = vi.fn()
+const pushMock = vi.fn()
+
+vi.mock('next/navigation', () => ({
+ useParams: () => ({ name: 'foo', tab: 'contexts' }),
+ usePathname: () => '/agents/foo/contexts',
+ useRouter: () => ({ push: pushMock, replace: replaceMock }),
+ useSearchParams: () => new URLSearchParams(),
+}))
+
+vi.mock('../AuthContext', () => ({
+ useAuth: () => ({ logout: vi.fn() }),
+}))
+
+vi.mock('../Sidebar', () => ({
+ Sidebar: () => <aside data-testid="sidebar" />,
+}))
+
+vi.mock('../HostIdentityTab', () => ({
+ HostIdentityTab: () => <div data-testid="identity-tab" />,
+}))
+
+vi.mock('../HostAccessTab', () => ({
+ HostAccessTab: () => <div data-testid="access-tab" />,
+}))
+
+vi.mock('../../lib/api', () => ({
+ apiSend: vi.fn(),
+ getHost: vi.fn(),
+ getHostDetailBundle: vi.fn(),
+ getLlmModels: vi.fn().mockResolvedValue({ rows: [] }),
+ getMcpServers: vi.fn(),
+ isSilentApiError: vi.fn().mockReturnValue(false),
+ updateContext: vi.fn(),
+}))
+
+const contextName = 'foo-12345'
+const baseContext = {
+ metadata: { name: contextName, resourceVersion: 'rv-context-1' },
+ spec: {
+ contextId: contextName,
+ description: 'Connector context for agent foo',
+ mcpServers: ['mcp-existing'],
+ },
+}
+
+function setupApiMocks() {
+ ;(api.getHostDetailBundle as unknown as ReturnType<typeof vi.fn>).mockResolvedValue({
+ host: {
+ metadata: { name: 'foo', resourceVersion: 'rv-host-1' },
+ spec: {
+ contextRef: contextName,
+ host: 'Foo',
+ model: { name: 'gpt-5.4-mini', provider: 'openai' },
+ },
+ },
+ contexts: [baseContext],
+ secrets: [],
+ users: [],
+ teams: [],
+ agentUsers: [],
+ agentTeams: [],
+ })
+ ;(api.getHost as unknown as ReturnType<typeof vi.fn>).mockResolvedValue({
+ metadata: { name: 'foo' },
+ spec: {},
+ })
+ ;(api.getMcpServers as unknown as ReturnType<typeof vi.fn>).mockResolvedValue({
+ items: [
+ { metadata: { name: 'mcp-existing' } },
+ { metadata: { name: 'mcp-new' } },
+ { metadata: { name: 'mcp-another' } },
+ ],
+ })
+ ;(api.updateContext as unknown as ReturnType<typeof vi.fn>).mockImplementation(
+ async (_name: string, payload: { spec: Record<string, unknown> }) => ({
+ metadata: { name: contextName, resourceVersion: 'rv-context-2' },
+ spec: payload.spec,
+ })
+ )
+ ;(api.apiSend as unknown as ReturnType<typeof vi.fn>).mockResolvedValue({})
+}
+
+function renderPage() {
+ return rtlRender(
+ <ToastProvider>
+ <HostDetailsPage />
+ </ToastProvider>
+ )
+}
+
+afterEach(() => {
+ cleanup()
+})
+
+describe('HostDetailsPage connectors', () => {
+ beforeEach(() => {
+ vi.clearAllMocks()
+ setupApiMocks()
+ })
+
+ it('adds connectors through the agent private context without showing its name', async () => {
+ renderPage()
+
+ expect(await screen.findByText('mcp-existing')).toBeInTheDocument()
+ expect(screen.queryByText(contextName)).not.toBeInTheDocument()
+
+ fireEvent.click(screen.getByRole('button', { name: 'Add connector', exact: true }))
+ await waitFor(() => expect(api.getMcpServers).toHaveBeenCalledTimes(1))
+ fireEvent.click(await screen.findByRole('option', { name: 'mcp-new' }))
+ fireEvent.click(screen.getByRole('dialog').getByRole('button', { name: 'Add connector' }))
+
+ await waitFor(() => expect(api.updateContext).toHaveBeenCalledTimes(1))
+ expect(api.updateContext).toHaveBeenCalledWith(
+ contextName,
+ expect.objectContaining({
+ metadata: { resourceVersion: 'rv-context-1' },
+ spec: expect.objectContaining({
+ description: 'Connector context for agent foo',
+ mcpServers: ['mcp-existing', 'mcp-new'],
+ }),
+ })
+ )
+ expect(await screen.findByText('mcp-new')).toBeInTheDocument()
+ })
+
+ it('confirms connector removal and updates the private context membership', async () => {
+ renderPage()
+
+ const removeButton = await screen.findByRole('button', {
+ name: 'Remove connector mcp-existing',
+ })
+ fireEvent.click(removeButton)
+ fireEvent.click(screen.getByRole('button', { name: 'Remove connector', exact: true }))
+
+ await waitFor(() => expect(api.updateContext).toHaveBeenCalledTimes(1))
+ expect(api.updateContext).toHaveBeenCalledWith(
+ contextName,
+ expect.objectContaining({
+ metadata: { resourceVersion: 'rv-context-1' },
+ spec: expect.objectContaining({ mcpServers: [] }),
+ })
+ )
+ await waitFor(() =>
+ expect(screen.queryByRole('button', { name: 'Remove connector mcp-existing' })).toBeNull()
+ )
+ })
+})
diff --git a/control-ui/components/__tests__/HostDetailsPage.identity.test.tsx b/control-ui/components/__tests__/HostDetailsPage.identity.test.tsx
index f112c249c..50be374a8 100644
--- a/control-ui/components/__tests__/HostDetailsPage.identity.test.tsx
+++ b/control-ui/components/__tests__/HostDetailsPage.identity.test.tsx
@@ -46,8 +46,10 @@ vi.mock('../../lib/api', () => ({
getAgentUsers: vi.fn(),
getHost: vi.fn(),
getHostDetailBundle: vi.fn(),
+ getMcpServers: vi.fn(),
updateAdminTeamAgents: vi.fn(),
updateAdminUserAgents: vi.fn(),
+ updateContext: vi.fn(),
// The model picker loads the operator allowlist via useLlmAllowedModels.
getLlmModels: vi.fn().mockResolvedValue({ rows: [] }),
isSilentApiError: vi.fn().mockReturnValue(false),
@@ -118,7 +120,7 @@ describe('HostDetailsPage identity integration', () => {
'Overview',
'Identity',
'Models & creds',
- 'Context',
+ 'Connectors',
'Access',
'Advanced',
])
@@ -269,54 +271,4 @@ describe('HostDetailsPage identity integration', () => {
expect(putCall![2].spec.host).toBe('foo-display')
})
- // Collateral regression: resetOverviewDrafts must NOT clobber a LIVE Context-tab
- // edit. contextRefDraft is written by both saveHost (Overview) and the Context
- // tab's own editingContext session; reverting it on Overview Edit-open/Cancel
- // while that session is open silently discards the operator's in-progress pick.
- it('preserves a live Context-tab selection across an Overview Edit-open/Cancel', async () => {
- // Two contexts so the Context tab can switch selection; saved = ctx-a.
- ;(api.getHostDetailBundle as unknown as ReturnType<typeof vi.fn>).mockResolvedValue({
- host: { ...host, spec: { ...host.spec, contextRef: 'ctx-a' } },
- contexts: [
- { metadata: { name: 'ctx-a' }, spec: { contextId: 'ctx-a' } },
- { metadata: { name: 'ctx-b' }, spec: { contextId: 'ctx-b' } },
- ],
- secrets: [{ name: 'openai-secret' }],
- users: [],
- teams: [],
- agentUsers: [],
- agentTeams: [],
- })
-
- // Land on the Context tab, open its edit session, pick a DIFFERENT context.
- mockParams = { name: 'foo', tab: 'contexts' }
- const view = render(<HostDetailsPage />)
- fireEvent.click(await screen.findByRole('button', { name: 'Edit context' }))
- fireEvent.change(screen.getByRole('combobox'), { target: { value: 'ctx-b' } })
- expect((screen.getByRole('combobox') as HTMLSelectElement).value).toBe('ctx-b')
-
- // Switch to Overview and fire BOTH resetOverviewDrafts sites: Edit-open, Cancel.
- mockParams = { name: 'foo' }
- view.rerender(
- <ToastProvider>
- <HostDetailsPage />
- </ToastProvider>
- )
- const [overviewEditButton] = await screen.findAllByRole('button', { name: 'Edit' })
- await waitFor(() => expect(overviewEditButton).toBeEnabled())
- fireEvent.click(overviewEditButton)
- fireEvent.click(screen.getByRole('button', { name: 'Cancel' }))
-
- // Back on the Context tab (still editing): the in-progress ctx-b must survive.
- mockParams = { name: 'foo', tab: 'contexts' }
- view.rerender(
- <ToastProvider>
- <HostDetailsPage />
- </ToastProvider>
- )
-
- // PINNING (T4): the Context select still shows the unsaved ctx-b, not the
- // reverted saved ctx-a. Pre-collateral-fix this reads 'ctx-a'.
- expect((screen.getByRole('combobox') as HTMLSelectElement).value).toBe('ctx-b')
- })
})
diff --git a/control-ui/components/__tests__/HostDetailsPage.lifecycle.test.tsx b/control-ui/components/__tests__/HostDetailsPage.lifecycle.test.tsx
index fab0c1693..9f1073a45 100644
--- a/control-ui/components/__tests__/HostDetailsPage.lifecycle.test.tsx
+++ b/control-ui/components/__tests__/HostDetailsPage.lifecycle.test.tsx
@@ -46,10 +46,12 @@ vi.mock('../../lib/api', () => ({
getAgentUsers: vi.fn(),
getHost: vi.fn(),
getHostDetailBundle: vi.fn(),
+ getMcpServers: vi.fn(),
getLlmModels: vi.fn().mockResolvedValue({ rows: [] }),
isSilentApiError: vi.fn().mockReturnValue(false),
updateAdminTeamAgents: vi.fn(),
updateAdminUserAgents: vi.fn(),
+ updateContext: vi.fn(),
}))
const baseSpec = {