Skip to content

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

fix(web-studio): avoid duplicate version prefix (#4203)

Axiomoth69cad83737f8
diff --git a/web-studio/src/routes/monitoring/-lib/version.test.ts b/web-studio/src/routes/monitoring/-lib/version.test.ts
new file mode 100644
index 000000000..be1b1703c
--- /dev/null
+++ b/web-studio/src/routes/monitoring/-lib/version.test.ts
@@ -0,0 +1,14 @@
+import { describe, expect, it } from 'vitest'
+
+import { stripVersionPrefix } from './version'
+
+describe('stripVersionPrefix', () => {
+ it('removes a leading version prefix', () => {
+ expect(stripVersionPrefix('v0.4.16')).toBe('0.4.16')
+ expect(stripVersionPrefix('V0.4.16')).toBe('0.4.16')
+ })
+
+ it('preserves versions without a prefix', () => {
+ expect(stripVersionPrefix('0.4.16')).toBe('0.4.16')
+ })
+})
diff --git a/web-studio/src/routes/monitoring/-lib/version.ts b/web-studio/src/routes/monitoring/-lib/version.ts
new file mode 100644
index 000000000..4bf83022e
--- /dev/null
+++ b/web-studio/src/routes/monitoring/-lib/version.ts
@@ -0,0 +1,3 @@
+export function stripVersionPrefix(version: string): string {
+ return version.replace(/^v/i, '')
+}
diff --git a/web-studio/src/routes/monitoring/route.tsx b/web-studio/src/routes/monitoring/route.tsx
index 7343c8bad..6120d16a6 100644
--- a/web-studio/src/routes/monitoring/route.tsx
+++ b/web-studio/src/routes/monitoring/route.tsx
@@ -32,6 +32,7 @@ import { useAppConnection } from '#/hooks/use-app-connection'
import { getHealth, getObserverSystem, getOvResult } from '#/lib/ov-client'
import { cn } from '#/lib/utils'
import { parseObserverStatus } from './-lib/parse-status'
+import { stripVersionPrefix } from './-lib/version'
export const Route = createFileRoute('/monitoring')({
component: MonitoringRoute,
@@ -236,7 +237,9 @@ function MonitoringRoute() {
</h1>
{overview?.version ? (
<Badge variant="outline" className="font-mono font-normal">
- {t('version', { version: overview.version })}
+ {t('version', {
+ version: stripVersionPrefix(overview.version),
+ })}
</Badge>
) : null}
</div>