Skip to content

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

TypeScript

fix(control-ui): avoid turbopack panic on legacy context redirects

Josué84e2c51c9120
diff --git a/control-ui/app/contexts/[slug]/[...rest]/page.tsx b/control-ui/app/contexts/[slug]/[...rest]/page.tsx
new file mode 100644
index 000000000..56d4ccd39
--- /dev/null
+++ b/control-ui/app/contexts/[slug]/[...rest]/page.tsx
@@ -0,0 +1,5 @@
+import { LegacyContextRedirect } from '@components/LegacyContextRedirect'
+
+export default function ContextSlugRestPage() {
+ return <LegacyContextRedirect />
+}
diff --git a/control-ui/app/contexts/[slug]/page.tsx b/control-ui/app/contexts/[slug]/page.tsx
new file mode 100644
index 000000000..87162e8ba
--- /dev/null
+++ b/control-ui/app/contexts/[slug]/page.tsx
@@ -0,0 +1,5 @@
+import { LegacyContextRedirect } from '@components/LegacyContextRedirect'
+
+export default function ContextSlugPage() {
+ return <LegacyContextRedirect />
+}
diff --git a/control-ui/app/contexts/page.tsx b/control-ui/app/contexts/page.tsx
new file mode 100644
index 000000000..dea2d37aa
--- /dev/null
+++ b/control-ui/app/contexts/page.tsx
@@ -0,0 +1,5 @@
+import { LegacyContextRedirect } from '@components/LegacyContextRedirect'
+
+export default function ContextsPage() {
+ return <LegacyContextRedirect />
+}
diff --git a/control-ui/app/contexts/[[...slug]]/page.tsx b/control-ui/components/LegacyContextRedirect/index.tsx
similarity index 95%
rename from control-ui/app/contexts/[[...slug]]/page.tsx
rename to control-ui/components/LegacyContextRedirect/index.tsx
index c7fc0ad74..1f624c40e 100644
--- a/control-ui/app/contexts/[[...slug]]/page.tsx
+++ b/control-ui/components/LegacyContextRedirect/index.tsx
@@ -17,8 +17,8 @@ import { contextAliases, contextForAlias } from '@lib/contextIdentity'
// /contexts/<unknown-slug>[/any/tab] → the Agents list (fail-safe)
//
// Lookup failures also fall back to the Agents list so a bookmark never dead-
-// ends. The write model is untouched: this page only navigates.
-export default function LegacyContextRedirectPage() {
+// ends. The write model is untouched: this component only navigates.
+export function LegacyContextRedirect() {
const router = useRouter()
const params = useParams<{ slug?: string[] | string }>()
diff --git a/control-ui/components/__tests__/LegacyContextRedirectPage.test.tsx b/control-ui/components/__tests__/LegacyContextRedirectPage.test.tsx
index f4484c627..163a0fe2f 100644
--- a/control-ui/components/__tests__/LegacyContextRedirectPage.test.tsx
+++ b/control-ui/components/__tests__/LegacyContextRedirectPage.test.tsx
@@ -1,7 +1,7 @@
import { beforeEach, describe, expect, it, vi } from 'vitest'
import { render, waitFor } from '@testing-library/react'
-import LegacyContextRedirectPage from '../../app/contexts/[[...slug]]/page'
import * as api from '../../lib/api'
+import { LegacyContextRedirect } from '../LegacyContextRedirect'
const replace = vi.fn()
let routeSlug: string[] | string | undefined
@@ -34,7 +34,7 @@ describe('LegacyContextRedirectPage', () => {
})
it('redirects a resource-name alias to the owning Agent', async () => {
- render(<LegacyContextRedirectPage />)
+ render(<LegacyContextRedirect />)
await waitFor(() => expect(replace).toHaveBeenCalledWith('/agents/agent-alpha/connectors'))
})
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index 7d2d66707..747129c34 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.556",
+ "version": "0.1.557",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.556",
+ "version": "0.1.557",
"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.json
index 9120c875e..0b06b4858 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.556",
+ "version": "0.1.557",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",