Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(v4-migration): treat projects without data as migrated (#15603)

Max Deichmann7926fea803e3
diff --git a/web/src/features/v4-migration/V4MigrationContent.clienttest.tsx b/web/src/features/v4-migration/V4MigrationContent.clienttest.tsx
index f3a2c51eea..be3b5378b8 100644
--- a/web/src/features/v4-migration/V4MigrationContent.clienttest.tsx
+++ b/web/src/features/v4-migration/V4MigrationContent.clienttest.tsx
@@ -12,6 +12,7 @@ import {
V4MigrationHeaderContent,
} from "./V4MigrationContent";
import { type MigrationCountState } from "./migrationData";
+import { type V4MigrationSdkState } from "./sdkVersionStatus";
const mocks = vi.hoisted(() => ({
routerPush: vi.fn(),
@@ -28,7 +29,8 @@ const mocks = vi.hoisted(() => ({
status: "latest" as const,
sdkUsageSeries: [],
upgradeRequiredCount: 0,
- },
+ delayedOtelIngestionCount: 0,
+ } as V4MigrationSdkState,
evals: { status: "loaded", count: 0 } as MigrationCountState,
apis: { status: "loaded", count: 1 } as MigrationCountState,
exports: { status: "loaded", count: 3 } as MigrationCountState,
@@ -107,6 +109,7 @@ describe("V4MigrationDetailsContent", () => {
mocks.submitAgentMessage.mockResolvedValue(undefined);
mocks.migrationData.evals = { status: "loaded", count: 0 };
mocks.canToggleV4 = true;
+ mocks.migrationData.sdk.status = "latest";
mocks.migrationData.apis = { status: "loaded", count: 1 };
mocks.migrationData.exports = { status: "loaded", count: 3 };
mocks.migrationData.apiUsage = [
@@ -176,6 +179,18 @@ describe("V4MigrationDetailsContent", () => {
).toBeInTheDocument();
});
+ it("shows no detected ingestion data without asking for SDK review", () => {
+ mocks.migrationData.sdk.status = "no_data";
+
+ render(<V4MigrationDetailsContent projectId="project-1" />);
+
+ expect(screen.getByText("No data detected")).toBeInTheDocument();
+ expect(
+ screen.getByText(/No ingestion data was detected in the last 14 days/),
+ ).toBeInTheDocument();
+ expect(screen.queryByText("Needs review")).not.toBeInTheDocument();
+ });
+
it("shows the preview-toggle section only when the session can toggle v4", () => {
const { unmount } = render(
<V4MigrationDetailsContent projectId="project-1" />,
diff --git a/web/src/features/v4-migration/V4MigrationContent.tsx b/web/src/features/v4-migration/V4MigrationContent.tsx
index bafc30bc83..81787c832b 100644
--- a/web/src/features/v4-migration/V4MigrationContent.tsx
+++ b/web/src/features/v4-migration/V4MigrationContent.tsx
@@ -180,14 +180,14 @@ function V4MigrationSdkSection({ sdk }: { sdk: V4MigrationSdkState }) {
<Chip variant="success">Up to date</Chip>
) : sdk.status === "otel_realtime" ? (
<Chip variant="success">OTel real-time</Chip>
+ ) : sdk.status === "no_data" ? (
+ <Chip variant="success">No data detected</Chip>
) : sdk.status === "checking" ? (
<Chip variant="warning">Checking</Chip>
) : sdk.status === "otel_header_required" ? (
<Chip variant="warning">OTel header required</Chip>
) : sdk.status === "unknown" ? (
- <Chip variant="warning">
- {detectedSdkSeries.length > 0 ? "Needs review" : "Not detected"}
- </Chip>
+ <Chip variant="warning">Needs review</Chip>
) : sdk.status === "error" ? (
<Chip variant="warning">Check failed</Chip>
) : (
@@ -212,16 +212,10 @@ function V4MigrationSdkSection({ sdk }: { sdk: V4MigrationSdkState }) {
</>
) : sdk.status === "otel_realtime" ? (
"OTel data is using real-time ingestion. No ingestion header update is required."
+ ) : sdk.status === "no_data" ? (
+ `No ingestion data was detected in the last ${V4_MIGRATION_LOOKBACK_DAYS} days.`
) : sdk.status === "unknown" ? (
- detectedSdkSeries.length > 0 ? (
- "We could not recognize every detected SDK version. Verify that these SDKs are up to date."
- ) : (
- <>
- We could not detect an attributed Langfuse SDK in traces from the
- last 7 days. If this project uses one, verify that it is up to
- date.
- </>
- )
+ "We could not recognize every detected SDK version. Verify that these SDKs are up to date."
) : sdk.status === "error" ? (
"We could not check the latest traces for this project. Try again later."
) : sdk.status === "latest" ? (
diff --git a/web/src/features/v4-migration/V4MigrationStatusPage.clienttest.tsx b/web/src/features/v4-migration/V4MigrationStatusPage.clienttest.tsx
index 803d650492..f60b843334 100644
--- a/web/src/features/v4-migration/V4MigrationStatusPage.clienttest.tsx
+++ b/web/src/features/v4-migration/V4MigrationStatusPage.clienttest.tsx
@@ -12,7 +12,8 @@ const mocks = vi.hoisted(() => ({
| "latest"
| "legacy"
| "otel_realtime"
- | "otel_header_required",
+ | "otel_header_required"
+ | "no_data",
sdkUsageSeries: [],
upgradeRequiredCount: 0,
delayedOtelIngestionCount: 0,
@@ -126,7 +127,7 @@ describe("V4MigrationStatusPage", () => {
it("shows migration readiness to project members", () => {
render(<V4MigrationStatusPage />);
- expect(screen.getByText("Ready")).toBeInTheDocument();
+ expect(screen.getByText("Migrated")).toBeInTheDocument();
expect(screen.getByText("of 1 projects migrated")).toBeInTheDocument();
});
@@ -204,8 +205,22 @@ describe("V4MigrationStatusPage", () => {
render(<V4MigrationStatusPage />);
- expect(screen.getByText("Ready")).toBeInTheDocument();
+ expect(screen.getByText("Migrated")).toBeInTheDocument();
expect(screen.getByText("OTel real-time")).toBeInTheDocument();
expect(screen.queryByText("Latest")).not.toBeInTheDocument();
});
+
+ it("shows no detected data while considering the project migrated", () => {
+ mocks.sdk = {
+ status: "no_data",
+ sdkUsageSeries: [],
+ upgradeRequiredCount: 0,
+ delayedOtelIngestionCount: 0,
+ };
+
+ render(<V4MigrationStatusPage />);
+
+ expect(screen.getByText("Migrated")).toBeInTheDocument();
+ expect(screen.getByText("No data detected")).toBeInTheDocument();
+ });
});
diff --git a/web/src/features/v4-migration/V4MigrationStatusPage.tsx b/web/src/features/v4-migration/V4MigrationStatusPage.tsx
index d941270172..14c7629237 100644
--- a/web/src/features/v4-migration/V4MigrationStatusPage.tsx
+++ b/web/src/features/v4-migration/V4MigrationStatusPage.tsx
@@ -68,7 +68,7 @@ function AffectedCell({ count }: { count: MigrationCountState }) {
function StatusPill({ readiness }: { readiness: ProjectMigrationReadiness }) {
const label =
readiness === "ready"
- ? "Ready"
+ ? "Migrated"
: readiness === "checking"
? "Checking"
: readiness === "unavailable"
@@ -211,15 +211,17 @@ function OrgStatusSection({
? 5
: row.status?.sdk.status === "otel_realtime"
? 5
- : row.status?.sdk.status === "legacy"
- ? 4
- : row.status?.sdk.status === "otel_header_required"
- ? 3
- : row.status?.sdk.status === "unknown"
- ? 2
- : row.status?.sdk.status === "checking"
- ? 1
- : 0;
+ : row.status?.sdk.status === "no_data"
+ ? 5
+ : row.status?.sdk.status === "legacy"
+ ? 4
+ : row.status?.sdk.status === "otel_header_required"
+ ? 3
+ : row.status?.sdk.status === "unknown"
+ ? 2
+ : row.status?.sdk.status === "checking"
+ ? 1
+ : 0;
case "evals":
return row.status?.evals.count ?? 0;
case "apis":
@@ -336,6 +338,10 @@ function OrgStatusSection({
<span className="text-foreground-tertiary">
OTel real-time
</span>
+ ) : row.status.sdk.status === "no_data" ? (
+ <span className="text-foreground-tertiary">
+ No data detected
+ </span>
) : row.status.sdk.status === "checking" ? (
<span className="text-foreground-tertiary">
Checking…
diff --git a/web/src/features/v4-migration/migrationData.clienttest.ts b/web/src/features/v4-migration/migrationData.clienttest.ts
index f154373666..693186c1f6 100644
--- a/web/src/features/v4-migration/migrationData.clienttest.ts
+++ b/web/src/features/v4-migration/migrationData.clienttest.ts
@@ -24,13 +24,13 @@ const migrationStatus = (
});
describe("v4 migration data", () => {
- it("uses a stable seven-day range aligned to the hour", () => {
+ it("uses a stable fourteen-day range aligned to the hour", () => {
const range = createV4MigrationDetectionRange(
new Date("2026-07-23T10:42:31.000Z").getTime(),
);
expect(range).toEqual({
- fromTimestamp: new Date("2026-07-16T11:00:00.000Z"),
+ fromTimestamp: new Date("2026-07-09T11:00:00.000Z"),
toTimestamp: new Date("2026-07-23T11:00:00.000Z"),
});
});
@@ -62,6 +62,16 @@ describe("v4 migration data", () => {
}),
),
).toBe("ready");
+ expect(
+ getProjectMigrationReadiness(
+ migrationStatus({
+ sdk: {
+ ...migrationStatus().sdk,
+ status: "no_data",
+ },
+ }),
+ ),
+ ).toBe("ready");
expect(
getProjectMigrationReadiness(migrationStatus({ evals: loaded(1) })),
).toBe("action-needed");
diff --git a/web/src/features/v4-migration/migrationData.ts b/web/src/features/v4-migration/migrationData.ts
index d0304520cb..261f532483 100644
--- a/web/src/features/v4-migration/migrationData.ts
+++ b/web/src/features/v4-migration/migrationData.ts
@@ -2,7 +2,7 @@ import { type RouterOutputs } from "@/src/utils/api";
import { normalizeLegacyApiEntrypoint } from "@/src/features/v4/utils";
import { type V4MigrationSdkState } from "@/src/features/v4-migration/sdkVersionStatus";
-export const V4_MIGRATION_LOOKBACK_DAYS = 7;
+export const V4_MIGRATION_LOOKBACK_DAYS = 14;
const V4_MIGRATION_LOOKBACK_MS =
V4_MIGRATION_LOOKBACK_DAYS * 24 * 60 * 60 * 1000;
@@ -82,7 +82,9 @@ export const getProjectMigrationReadiness = (
return "checking";
}
if (
- (status.sdk.status === "latest" || status.sdk.status === "otel_realtime") &&
+ (status.sdk.status === "latest" ||
+ status.sdk.status === "otel_realtime" ||
+ status.sdk.status === "no_data") &&
counts.every((count) => count.count === 0)
) {
return "ready";
diff --git a/web/src/features/v4-migration/sdkVersionStatus.clienttest.ts b/web/src/features/v4-migration/sdkVersionStatus.clienttest.ts
index 7fe6bcee4e..470fb315b0 100644
--- a/web/src/features/v4-migration/sdkVersionStatus.clienttest.ts
+++ b/web/src/features/v4-migration/sdkVersionStatus.clienttest.ts
@@ -119,7 +119,7 @@ describe("v4 migration SDK status", () => {
).toMatchObject({ status: "unknown" });
});
- it("distinguishes loading, errors, and a loaded empty result", () => {
+ it("distinguishes loading, errors, and a loaded result with no data", () => {
expect(
getV4MigrationSdkState({
summary: undefined,
@@ -134,7 +134,7 @@ describe("v4 migration SDK status", () => {
isError: true,
}).status,
).toBe("error");
- expect(getLoadedSdkState().status).toBe("unknown");
+ expect(getLoadedSdkState().status).toBe("no_data");
});
it("formats detected SDK versions for migration copy", () => {
diff --git a/web/src/features/v4-migration/sdkVersionStatus.ts b/web/src/features/v4-migration/sdkVersionStatus.ts
index a51f0b02f7..82dd603a3c 100644
--- a/web/src/features/v4-migration/sdkVersionStatus.ts
+++ b/web/src/features/v4-migration/sdkVersionStatus.ts
@@ -7,6 +7,7 @@ import {
export type V4MigrationSdkStatus =
| "checking"
| "error"
+ | "no_data"
| "unknown"
| "otel_realtime"
| "otel_header_required"
@@ -87,17 +88,19 @@ export const getV4MigrationSdkState = (params: {
return {
status:
- upgradeRequiredCount > 0
- ? "legacy"
- : delayedOtelIngestionCount > 0
- ? "otel_header_required"
- : hasUnknownRecognizedSdk
- ? "unknown"
- : hasCompatibleSdk
- ? "latest"
- : hasRealtimeOtelIngestion
- ? "otel_realtime"
- : "unknown",
+ sdkUsageSeries.length === 0
+ ? "no_data"
+ : upgradeRequiredCount > 0
+ ? "legacy"
+ : delayedOtelIngestionCount > 0
+ ? "otel_header_required"
+ : hasUnknownRecognizedSdk
+ ? "unknown"
+ : hasCompatibleSdk
+ ? "latest"
+ : hasRealtimeOtelIngestion
+ ? "otel_realtime"
+ : "unknown",
sdkUsageSeries,
upgradeRequiredCount,
delayedOtelIngestionCount,