Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions web/packages/studio/src/constants/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ export const ROUTES = {
agentDetail: `/workspaces/:${P.workspace}/agents/:${P.agentName}`,
agentDeploymentsList: `/workspaces/:${P.workspace}/agent-deployments`,
agentDeploymentDetail: `/workspaces/:${P.workspace}/agent-deployments/:${P.agentDeploymentName}`,
/** Agent-evaluation jobs list (Phase 2 of the agent-eval UX). */
agentEvaluationsList: `/workspaces/:${P.workspace}/agents/evaluations`,
/** Detail view for a single agent-evaluation job. */
agentEvaluationDetail: `/workspaces/:${P.workspace}/agents/evaluations/:${P.agentEvalJobName}`,
modelCompare: `/workspaces/:${P.workspace}/playground`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ export const WorkspaceSideNav = ({ collapsed }: { collapsed?: boolean }) => {
];
const datasetSubItems = [...anonymizerNav, ...dataDesignerNav, ...safeSynthesizerNav];

// Agents and Models link to their own entity list page; the chevron expands the rest.
const agentsHref = agentItems.length > 0 ? getAgentsListRoute(workspace) : undefined;
// Agents and Models link to their own entity list page; the chevron expands any sub-items.
const agentsHref = showAgents ? getAgentsListRoute(workspace) : undefined;
const modelsHref = BASE_MODELS_ENABLED ? getWorkspaceBaseModelsRoute(workspace) : undefined;

const componentItems = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ import { ROUTE_PARAMS } from '@studio/constants/routes';
import { useWorkspaceFromPath } from '@studio/hooks/useWorkspaceFromPath';
import { useBreadcrumbs } from '@studio/providers/breadcrumbs/useBreadcrumbs';
import {
getAgentEvaluationsListRoute,
getAgentEvaluationsTabRoute,
getAgentsListRoute,
getFilesetRoute,
} from '@studio/routes/utils';
import { useRequiredPathParams } from '@studio/util/hooks/useRequiredPathParams';
import { useQuery, useQueryClient } from '@tanstack/react-query';
import { CircleX, ClipboardList, FlaskConical, ScrollText } from 'lucide-react';
import { type FC, useState } from 'react';
import { type FC, useEffect, useState } from 'react';
import { Link } from 'react-router';

const TERMINAL_STATUSES = new Set([
Expand All @@ -71,14 +71,6 @@ export const AgentEvaluationDetailRoute: FC = () => {
const toast = useToast();
const queryClient = useQueryClient();

useBreadcrumbs({
items: [
{ slotLabel: 'Agents', href: getAgentsListRoute(workspace) },
{ slotLabel: 'Evaluations', href: getAgentEvaluationsListRoute(workspace) },
{ slotLabel: jobName },
],
});

// Job + status — refetched while the job is non-terminal so the badge stays
// live without forcing a page reload.
const { data: job, isLoading: isLoadingJob } = useQuery({
Expand All @@ -88,6 +80,22 @@ export const AgentEvaluationDetailRoute: FC = () => {
refetchInterval: (query) => (isTerminal(query.state.data?.status) ? false : 5_000),
});

// The "Evaluations" crumb links the agent's eval tab, but the agent name only arrives with
// the loaded job — so set breadcrumbs from an effect keyed on it (the useBreadcrumbs `items`
// param runs once on mount and would keep the crumb non-clickable after the job resolves).
const agentName = job ? agentNameForJob(job) : null;
const { setBreadcrumbs } = useBreadcrumbs();
useEffect(() => {
setBreadcrumbs([
{ slotLabel: 'Agents', href: getAgentsListRoute(workspace) },
agentName
? { slotLabel: 'Evaluations', href: getAgentEvaluationsTabRoute(workspace, agentName) }
: { slotLabel: 'Evaluations' },
{ slotLabel: jobName },
]);
return () => setBreadcrumbs([]);
}, [setBreadcrumbs, workspace, agentName, jobName]);

const isJobTerminal = isTerminal(job?.status);
const canCancelJob = !!job?.status && !isJobTerminal;
const [cancelModalOpen, setCancelModalOpen] = useState(false);
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
// SPDX-License-Identifier: Apache-2.0

export { AgentEvaluationDetailRoute } from '@studio/routes/agents/AgentEvaluationsRoute/AgentEvaluationDetailRoute';
export { AgentEvaluationsListRoute } from '@studio/routes/agents/AgentEvaluationsRoute/AgentEvaluationsListRoute';
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ const STUDIO_LINK_PATH_TEMPLATES: Record<string, string> = {
agent_chat: '/workspaces/{workspace}/agents/{name}?tab=chat-playground',
agent_deployments: '/workspaces/{workspace}/agents',
agent_deployment: '/workspaces/{workspace}/agents/{name}',
agent_evaluations: '/workspaces/{workspace}/agents/evaluations',
agent_evaluation: '/workspaces/{workspace}/agents/evaluations/{name}',
agent_monitor: '/workspaces/{workspace}/agents/monitor',
base_models: '/workspaces/{workspace}/base-models',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,6 @@ describe('getStudioUiNavigationSuggestion', () => {
});
});

it('prefers agent-specific evaluation routes over general model evaluations', () => {
expect(getStudioUiNavigationSuggestion('Evaluate an agent', workspace)).toMatchObject({
id: 'agent-evaluations',
href: '/workspaces/default/agents/evaluations',
});
});

it('returns undefined when the matching feature is disabled', () => {
mockFeatureFlags({ guardrailsEnabled: false });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import { featureFlags } from '@studio/constants/featureFlags';
import type { FeatureFlags } from '@studio/constants/featureFlags/featureFlags';
import {
getAgentEvaluationsListRoute,
getAgentMonitorRoute,
getAgentsListRoute,
getDataDesignerJobListRoute,
Expand Down Expand Up @@ -59,19 +58,6 @@ const STUDIO_UI_DESTINATIONS: readonly StudioUiDestination[] = [
/\bsafety data\b/i,
],
},
{
id: 'agent-evaluations',
title: 'Open Agent Evaluations',
description: 'Studio has a UI for submitting and reviewing agent evaluation jobs.',
getHref: getAgentEvaluationsListRoute,
requiredFeatureFlags: ['agentsEnabled'],
patterns: [
/\bagent (eval|evaluation|evaluations)\b/i,
/\bevaluat(e|ing|ion)s? (an? )?agent\b/i,
/\brun (an? )?(eval|evaluation) (for|on) (an? )?agent\b/i,
/\b(agent|agents).*\b(eval|evaluation|evaluations) jobs?\b/i,
],
},
{
id: 'agent-monitor',
title: 'Open Agent Monitor',
Expand Down
27 changes: 2 additions & 25 deletions web/packages/studio/src/routes/groups/agentRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@ import { ErrorPanel } from '@nemo/common/src/components/ErrorPanel';
import { AGENTS_ENABLED, MONITOR_ENABLED } from '@studio/constants/environment';
import { ROUTES } from '@studio/constants/routes';
import { iconColorClass } from '@studio/routes/constants';
import {
agentsRoutes,
getAgentEvaluationsListRoute,
getAgentMonitorRoute,
} from '@studio/routes/utils';
import { Form, DatabaseCheck } from 'lucide-react';
import { agentsRoutes, getAgentMonitorRoute } from '@studio/routes/utils';
import { DatabaseCheck } from 'lucide-react';
import { lazy } from 'react';
import type { RouteObject } from 'react-router';

Expand All @@ -33,13 +29,6 @@ const AgentMonitorRoute = lazy(() =>
default: m.AgentMonitorRoute,
}))
);
const AgentEvaluationsListRoute =
AGENTS_ENABLED &&
lazy(() =>
import('@studio/routes/agents/AgentEvaluationsRoute').then((m) => ({
default: m.AgentEvaluationsListRoute,
}))
);
const AgentEvaluationDetailRoute =
AGENTS_ENABLED &&
lazy(() =>
Expand All @@ -63,11 +52,6 @@ export const agentRoutes: RouteObject[] = agentsRoutes([
},
]
: []),
{
path: ROUTES.workspace.agentEvaluationsList,
element: AgentEvaluationsListRoute ? <AgentEvaluationsListRoute /> : null,
errorElement: <ErrorPanel title="Agent Evaluations" />,
},
{
path: ROUTES.workspace.agentEvaluationDetail,
element: AgentEvaluationDetailRoute ? <AgentEvaluationDetailRoute /> : null,
Expand All @@ -83,13 +67,6 @@ export const agentRoutes: RouteObject[] = agentsRoutes([
export const getAgentSideNavItems = (workspace: string) =>
AGENTS_ENABLED
? [
{
id: 'agent-evaluations',
slotIcon: <Form className={iconColorClass} />,
// Qualified: the rail hoists this out of Agents, next to the model evaluations link.
slotLabel: 'Agent Evaluations',
href: getAgentEvaluationsListRoute(workspace),
},
...(MONITOR_ENABLED
? [
{
Expand Down
4 changes: 0 additions & 4 deletions web/packages/studio/src/routes/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -633,10 +633,6 @@ export const getAgentMonitorRoute = (workspace: string) => {
return generatePath(ROUTES.workspace.agentMonitor, { workspace });
};

export const getAgentEvaluationsListRoute = (workspace: string) => {
return generatePath(ROUTES.workspace.agentEvaluationsList, { workspace });
};

export const getAgentEvaluationDetailRoute = (workspace: string, agentEvalJobName: string) => {
return generatePath(ROUTES.workspace.agentEvaluationDetail, {
workspace,
Expand Down