Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
fix(control-ui): show agent display names in the member Agents tab (TASK-234)
M505c01a3ed3c
diff --git a/control-ui/app/profile-admin/users/[userId]/page.tsx b/control-ui/app/profile-admin/users/[userId]/page.tsxindex 6cbaaa33b..969495860 100644--- a/control-ui/app/profile-admin/users/[userId]/page.tsx+++ b/control-ui/app/profile-admin/users/[userId]/page.tsx@@ -1126,38 +1126,45 @@ export default function UserDetailsPage() {</tr></thead><tbody>- {effectiveAgentNames.map(agentName => (- <tr key={agentName}>- <td>- <button- type="button"- className="cu-link"- onClick={() => router.push(CONTROL_ROUTES.agents.detail(agentName))}- >- {agentName}- </button>- </td>- <td className="cu-table__cell-actions">- <RowActionsMenu- ariaLabel={`Actions for ${agentName}`}- actions={[- {- key: 'view',- label: 'View details',- onClick: () => router.push(CONTROL_ROUTES.agents.detail(agentName)),- },- {- key: 'revoke',- label: 'Revoke access',- onClick: () => void revokeAgentAccess(agentName),- disabled: busy,- danger: true,- },- ]}- />- </td>- </tr>- ))}+ {effectiveAgentNames.map(agentName => {+ // TASK-234: show the agent's display name (spec.host) —+ // the same resolution the add-agent picker above uses — so+ // a newly created or renamed agent reads by its name, not+ // its immutable slug. Links/actions stay keyed by the slug.+ const agentDisplayName = getAgentDisplayName(agentName, hosts)+ return (+ <tr key={agentName}>+ <td>+ <button+ type="button"+ className="cu-link"+ onClick={() => router.push(CONTROL_ROUTES.agents.detail(agentName))}+ >+ {agentDisplayName}+ </button>+ </td>+ <td className="cu-table__cell-actions">+ <RowActionsMenu+ ariaLabel={`Actions for ${agentDisplayName}`}+ actions={[+ {+ key: 'view',+ label: 'View details',+ onClick: () => router.push(CONTROL_ROUTES.agents.detail(agentName)),+ },+ {+ key: 'revoke',+ label: 'Revoke access',+ onClick: () => void revokeAgentAccess(agentName),+ disabled: busy,+ danger: true,+ },+ ]}+ />+ </td>+ </tr>+ )+ })}</tbody></DataTable></TableViewport>diff --git a/control-ui/components/__tests__/ProfileAdminAgentCompatibility.test.tsx b/control-ui/components/__tests__/ProfileAdminAgentCompatibility.test.tsxindex eceba9959..ec3249353 100644--- a/control-ui/components/__tests__/ProfileAdminAgentCompatibility.test.tsx+++ b/control-ui/components/__tests__/ProfileAdminAgentCompatibility.test.tsx@@ -140,6 +140,37 @@ describe('profile-admin agent compatibility access', () => {expect(within(list).getAllByRole('listitem')).toHaveLength(3)})+ // TASK-234: the member Agents tab must show the agent's display name+ // (spec.host) — e.g. a newly created or renamed agent — with the immutable+ // identifier as fallback when no display name exists.+ it('shows agent display names in the member Agents tab, falling back to the identifier', async () => {+ vi.mocked(api.getHosts).mockResolvedValue({+ items: [+ {+ metadata: { name: 'agent-alpha' },+ spec: { contextRef: 'ctx-alpha', host: 'Alpha Bot' },+ },+ { metadata: { name: 'agent-beta' }, spec: { contextRef: 'ctx-beta' } },+ ],+ })+ vi.mocked(api.getAdminUserContexts).mockResolvedValue({+ userId: 'user-1',+ contextIds: ['ctx-alpha', 'ctx-beta'],+ })+ vi.mocked(api.getAdminUserAgents).mockResolvedValue({+ userId: 'user-1',+ agentNames: ['agent-alpha', 'agent-beta'],+ deletedAgentNames: [],+ deletedHistoryLimit: 10,+ })++ renderUserDetails()++ expect(await screen.findByRole('button', { name: 'Alpha Bot' })).toBeInTheDocument()+ expect(screen.getByRole('button', { name: 'agent-beta' })).toBeInTheDocument()+ expect(screen.queryByRole('button', { name: 'agent-alpha' })).not.toBeInTheDocument()+ })+it('removes only owned Context grants when a member loses final agent access', async () => {vi.mocked(api.getAdminUserContexts).mockResolvedValueOnce({ userId: 'user-1', contextIds: ['ctx-alpha', 'ctx-unrelated'] })diff --git a/control-ui/package-lock.json b/control-ui/package-lock.jsonindex 74da16267..a2b8166f9 100644--- a/control-ui/package-lock.json+++ b/control-ui/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-control-ui",- "version": "0.1.578",+ "version": "0.1.579","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-control-ui",- "version": "0.1.578",+ "version": "0.1.579","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.jsonindex 1b1fd6549..ff879807f 100644--- a/control-ui/package.json+++ b/control-ui/package.json@@ -1,6 +1,6 @@{"name": "clerum-control-ui",- "version": "0.1.578",+ "version": "0.1.579","private": true,"scripts": {"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",