Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
adapt(desktop-ui): surface connector actionError in the AgentWorkspace panel
Diego Zacariasfc2759cc8664
diff --git a/desktop-app/ui/src/components/agents/AgentWorkspace.tsx b/desktop-app/ui/src/components/agents/AgentWorkspace.tsxindex 529f7f568..be32a1db0 100644--- a/desktop-app/ui/src/components/agents/AgentWorkspace.tsx+++ b/desktop-app/ui/src/components/agents/AgentWorkspace.tsx@@ -5,7 +5,7 @@ import { useAuthContext } from '@contexts/AuthContext'import { useChatListContext } from '@contexts/ChatListContext'import { useMcpRuntimeContext } from '@contexts/McpRuntimeContext'import { useNavigationContext } from '@contexts/NavigationContext'-import { DataTable, EmptyState, IconButton, MenuItem } from '@components/Common'+import { DataTable, EmptyState, IconButton, MenuItem, StatusBanner } from '@components/Common'import { PageBreadcrumb } from '@components/PageBreadcrumb'import type { PageBreadcrumbItem } from '@components/PageBreadcrumb/types'import { ResourceBreadcrumbSwitcher } from '@components/ResourceBreadcrumbSwitcher'@@ -106,6 +106,7 @@ export function AgentWorkspace({ mode = 'agents', scrollContainerRef }: AgentWorconst {agents: connectorAgents,pendingKey: connectorPendingKey,+ actionError: connectorActionError,authorize: authorizeConnector,disconnect: disconnectConnector,} = useConnectorsController()@@ -493,6 +494,14 @@ export function AgentWorkspace({ mode = 'agents', scrollContainerRef }: AgentWor<section className="agent-mcp-panel" aria-label="Agent connectors"><AgentHero agentName={selectedAgentDisplay} subtitle={routeSubtitle} />+ {/* Parity with McpServersPage: the controller never rejects and+ records any write failure in `actionError`, so both mounts of+ it must surface that error — otherwise a failed+ authorize/disconnect from this panel is silent (R1-B1). */}+ {connectorActionError ? (+ <StatusBanner tone="error">{connectorActionError}</StatusBanner>+ ) : null}+<McpServerHealthTablehostRef={selectedAgent ?? ''}mcpServerNames={selectedAgentMcpServerNames}@@ -501,10 +510,12 @@ export function AgentWorkspace({ mode = 'agents', scrollContainerRef }: AgentWoralwaysExpandedconnectorActions={connectorActionsByName}onAuthorize={input => {- authorizeConnector(input).catch(() => undefined)+ // Failures surface via `connectorActionError`; the hook never+ // rejects, so there is nothing to catch here.+ void authorizeConnector(input)}}onDisconnect={input => {- disconnectConnector(input).catch(() => undefined)+ void disconnectConnector(input)}}/></section>diff --git a/desktop-app/ui/src/components/agents/__tests__/AgentWorkspace.connectors.test.tsx b/desktop-app/ui/src/components/agents/__tests__/AgentWorkspace.connectors.test.tsxindex 5c0ca7c3c..19052e4b9 100644--- a/desktop-app/ui/src/components/agents/__tests__/AgentWorkspace.connectors.test.tsx+++ b/desktop-app/ui/src/components/agents/__tests__/AgentWorkspace.connectors.test.tsx@@ -23,6 +23,7 @@ const navMock = vi.hoisted(() => ({const connectorsMock = vi.hoisted(() => ({agents: [] as RpcConnectorsResult['agents'],pendingKey: null as string | null,+ actionError: null as string | null,authorize: vi.fn(async () => undefined),disconnect: vi.fn(async () => undefined),}))@@ -83,6 +84,7 @@ vi.mock('@hooks/domain/useConnectorsController', async importActual => ({error: null,agents: connectorsMock.agents,pendingKey: connectorsMock.pendingKey,+ actionError: connectorsMock.actionError,refresh: vi.fn(),reset: vi.fn(),authorize: connectorsMock.authorize,@@ -133,6 +135,7 @@ describe('AgentWorkspace — Connectors tab OAuth actions', () => {navMock.selectedAgentRoute = 'mcp-servers'connectorsMock.agents = []connectorsMock.pendingKey = null+ connectorsMock.actionError = nullmcpMock.selectedAgentMcpServers = []})@@ -189,6 +192,22 @@ describe('AgentWorkspace — Connectors tab OAuth actions', () => {})})+ it('surfaces a controller write failure (actionError) in an error banner (R1-B1 parity with McpServersPage)', () => {+ // The controller never rejects; it records any authorize/disconnect write+ // failure in `actionError`. Both mounts of it (McpServersPage AND this agent+ // panel) must render that error, or a failed action is silent here.+ connectorsMock.agents = CONNECTORS.agents+ connectorsMock.actionError = 'Couldn\'t disconnect "monday". write boom'+ mcpMock.selectedAgentMcpServers = [{ name: 'monday' }]++ renderTab()++ const panel = screen.getByRole('region', { name: 'Agent connectors' })+ expect(+ within(panel).getByText('Couldn\'t disconnect "monday". write boom')+ ).toBeTruthy()+ })+it('renders no OAuth action button for a no_oauth connector', () => {connectorsMock.agents = CONNECTORS.agentsmcpMock.selectedAgentMcpServers = [