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
5 changes: 5 additions & 0 deletions .changeset/fix-github-breadcrumb.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@inkeep/agents-manage-ui": patch
---

Fix breadcrumb error on GitHub work-app detail page
33 changes: 14 additions & 19 deletions agents-manage-ui/src/app/[tenantId]/@breadcrumbs/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@ import Link from 'next/link';
import type { FC } from 'react';
import { getJobName } from '@/app/[tenantId]/projects/[projectId]/evaluations/jobs/[configId]/page';
import { STATIC_LABELS } from '@/constants/theme';
import { getFullAgentAction } from '@/lib/actions/agent-full';
import { getFullAgent } from '@/lib/api/agent-full-client';
import { fetchArtifactComponent } from '@/lib/api/artifact-components';
import { fetchCredential } from '@/lib/api/credentials';
import { fetchDataComponent } from '@/lib/api/data-components';
import { fetchDataset } from '@/lib/api/datasets';
import { fetchEvaluationJobConfig } from '@/lib/api/evaluation-job-configs';
import { fetchEvaluationRunConfig } from '@/lib/api/evaluation-run-configs';
import { fetchExternalAgent } from '@/lib/api/external-agents';
import { fetchWorkAppGitHubInstallationDetail } from '@/lib/api/github';
import { fetchProject } from '@/lib/api/projects';
import { getScheduledTrigger } from '@/lib/api/scheduled-triggers';
import { fetchSkill } from '@/lib/api/skills';
import { fetchMCPTool } from '@/lib/api/tools';
import { fetchNangoProviders } from '@/lib/mcp-tools/nango';
import { sentry } from '@/lib/sentry';
import { cn } from '@/lib/utils';
import { getErrorCode, getStatusCodeFromErrorCode } from '@/lib/utils/error-serialization';

Expand Down Expand Up @@ -47,14 +49,8 @@ async function getCrumbs(params: BreadcrumbsProps['params']) {
return project.data.name;
},
async agents(id) {
const result = await getFullAgentAction(tenantId, projectId, id);
if (result.success) {
return result.data.name;
}
throw {
message: result.error,
code: result.code,
};
const result = await getFullAgent(tenantId, projectId, id);
return result.data.name;
},
async artifacts(id) {
const artifact = await fetchArtifactComponent(tenantId, projectId, id);
Expand Down Expand Up @@ -102,16 +98,9 @@ async function getCrumbs(params: BreadcrumbsProps['params']) {
async runs(_id) {
return 'Run';
},

async webhooks(agentId: string) {
const result = await getFullAgentAction(tenantId, projectId, agentId);
if (result.success) {
return result.data.name;
}
throw {
message: result.error,
code: result.code,
};
const result = await getFullAgent(tenantId, projectId, agentId);
return result.data.name;
},
async skills(id) {
const result = await fetchSkill(tenantId, projectId, id);
Expand All @@ -121,6 +110,10 @@ async function getCrumbs(params: BreadcrumbsProps['params']) {
const trigger = await getScheduledTrigger(tenantId, projectId, slug[3], id);
return trigger.name;
},
async github(id) {
const result = await fetchWorkAppGitHubInstallationDetail(tenantId, id);
return result.installation.accountLogin;
},
};

function addCrumb({ segment, label }: { segment: string; label: string }) {
Expand Down Expand Up @@ -157,7 +150,9 @@ async function getCrumbs(params: BreadcrumbsProps['params']) {
: undefined;
label = fetcher ? await fetcher(segment) : getStaticLabel(segment);
if (!label) {
throw new Error(`Unknown breadcrumb segment "${segment}"`);
const error = new Error(`Unknown breadcrumb segment "${segment}"`);
sentry.captureException(error);
throw error;
}
}
} catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion agents-manage-ui/src/app/[tenantId]/stats/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const TIME_RANGES = {
'30d': { label: 'Last 30 days', hours: 24 * 30 },
} as const;

export default function ProjectsStatsPage({ params }: { params: Promise<{ tenantId: string }> }) {
export default function ProjectsStatsPage({ params }: PageProps<'/[tenantId]/stats'>) {
const { tenantId } = use(params);
const router = useRouter();
const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ import { formatDate, formatDateTimeTable } from '@/lib/utils/format-date';
import { getGitHubInstallationSettingsUrl } from '@/lib/utils/work-app-github-utils';
import GitHubInstallationDetailLoading from './loading';

interface PageParams {
params: Promise<{ tenantId: string; installationId: string }>;
}

function getStatusBadgeVariant(status: string) {
switch (status) {
case 'active':
Expand Down Expand Up @@ -70,7 +66,9 @@ const ItemValue = ({ children }: { children: React.ReactNode }) => {
return <div className="flex w-full text-sm text-muted-foreground">{children}</div>;
};

export default function GitHubInstallationDetailPage({ params }: PageParams) {
export default function GitHubInstallationDetailPage({
params,
}: PageProps<'/[tenantId]/work-apps/github/[installationId]'>) {
const { tenantId, installationId } = use(params);
const router = useRouter();
const [data, setData] = useState<WorkAppGitHubInstallationDetail | null>(null);
Expand Down
8 changes: 3 additions & 5 deletions agents-manage-ui/src/app/[tenantId]/work-apps/github/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ import type { WorkAppGitHubInstallation } from '@/lib/api/github';
import { fetchWorkAppGitHubInstallations } from '@/lib/api/github';
import GitHubSettingsLoading from './loading';

interface PageParams {
params: Promise<{ tenantId: string }>;
}

export default function WorkAppGitHubSettingsPage({ params }: PageParams) {
export default function WorkAppGitHubSettingsPage({
params,
}: PageProps<'/[tenantId]/work-apps/github'>) {
const { tenantId } = use(params);
const router = useRouter();
const searchParams = useSearchParams();
Expand Down
7 changes: 2 additions & 5 deletions agents-manage-ui/src/app/[tenantId]/work-apps/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
'use client';

import { use } from 'react';
import { WorkAppsOverview } from '@/features/work-apps/common';
import { SlackProvider } from '@/features/work-apps/slack';

function WorkAppsPage({ params }: { params: Promise<{ tenantId: string }> }) {
const { tenantId } = use(params);
async function WorkAppsPage({ params }: PageProps<'/[tenantId]/work-apps'>) {
const { tenantId } = await params;

return (
<SlackProvider tenantId={tenantId}>
Expand Down
7 changes: 2 additions & 5 deletions agents-manage-ui/src/app/[tenantId]/work-apps/slack/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
'use client';

import { use } from 'react';
import { SlackDashboard, SlackProvider } from '@/features/work-apps/slack';

function SlackWorkAppPage({ params }: { params: Promise<{ tenantId: string }> }) {
const { tenantId } = use(params);
async function SlackWorkAppPage({ params }: PageProps<'/[tenantId]/work-apps/slack'>) {
const { tenantId } = await params;

return (
<SlackProvider tenantId={tenantId}>
Expand Down
5 changes: 1 addition & 4 deletions agents-manage-ui/src/lib/actions/agent-full.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import type { AgentApiInsert } from '@inkeep/agents-core/client-exports';
import { revalidatePath } from 'next/cache';
import { cache } from 'react';
import {
ApiError,
createAgent as apiCreateAgent,
Expand Down Expand Up @@ -159,7 +158,7 @@ export async function createFullAgentAction(
/**
* Get a full agent by ID
*/
async function $getFullAgentAction(
export async function getFullAgentAction(
tenantId: string,
projectId: string,
agentId: string
Expand Down Expand Up @@ -188,8 +187,6 @@ async function $getFullAgentAction(
}
}

export const getFullAgentAction = cache($getFullAgentAction);

/**
* Update or create a full agent (upsert)
*/
Expand Down
5 changes: 4 additions & 1 deletion agents-manage-ui/src/lib/api/agent-full-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

import type { AgentApiInsert } from '@inkeep/agents-core/client-exports';
import { cache } from 'react';
import type {
Agent,
CreateAgentResponse,
Expand Down Expand Up @@ -92,7 +93,7 @@ export async function createFullAgent(
/**
* Get a full agent by ID
*/
export async function getFullAgent(
async function $getFullAgent(
tenantId: string,
projectId: string,
agentId: string
Expand All @@ -108,6 +109,8 @@ export async function getFullAgent(
);
}

export const getFullAgent = cache($getFullAgent);

/**
* Update or create a full agent (upsert)
*/
Expand Down
7 changes: 6 additions & 1 deletion biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@
},
"files": {
"ignoreUnknown": false,
"includes": ["**", "!packages/agents-manage-mcp", "!packages/agents-mcp"]
"includes": [
"**",
"!packages/agents-manage-mcp",
"!packages/agents-mcp",
"!**/__snapshots__/*.json"
]
},
"linter": {
"enabled": true,
Expand Down
Loading