Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix: Request artifact logs based on the selected kind. (#19716)

balibabu16ba92dd7b0f
diff --git a/web/src/hooks/__tests__/use-dataset-generate-status.test.tsx b/web/src/hooks/__tests__/use-dataset-generate-status.test.tsx
index d19e2f6b8c..3ba50464ce 100644
--- a/web/src/hooks/__tests__/use-dataset-generate-status.test.tsx
+++ b/web/src/hooks/__tests__/use-dataset-generate-status.test.tsx
@@ -1,7 +1,7 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { renderHook, waitFor } from '@testing-library/react';
import React from 'react';
-import { GenerateType } from '@/constants/knowledge';
+import { GenerateType, TraceType } from '@/constants/knowledge';
import { useTraceRunData } from '../use-dataset-generate';
@@ -83,6 +83,9 @@ describe('useTraceRunData (Go compile-status contract)', () => {
expect(info?.inflight).toBe(2);
expect(info?.backlog).toBe(1);
expect(info?.compilationError).toBe('');
+ // The trace type doubles as the backend `kind` alias, so each view's
+ // status request is scoped to its own compile type.
+ expect(mockStatus).toHaveBeenCalledWith('kb1', TraceType.Artifact);
});
it('rejects a non-zero business code instead of mapping to idle', async () => {
diff --git a/web/src/hooks/use-dataset-generate.ts b/web/src/hooks/use-dataset-generate.ts
index 42c35ae7f1..4cfad4bcf4 100644
--- a/web/src/hooks/use-dataset-generate.ts
+++ b/web/src/hooks/use-dataset-generate.ts
@@ -113,8 +113,10 @@ const useTraceQuery = (
// MySQL inflight/backlog entry counts and the error diagnostic, and
// derive the display status in useGenerateStatus. progress is only set
// so the shared refetch/status helpers keep their contract (idle->0,
- // running/pending->0, completed->1, error->0).
- const res = await getDatasetCompilationStatus(id!);
+ // running/pending->0, completed->1, error->0). The traceType doubles as
+ // the backend `kind` alias, scoping state/counts/error to this compile
+ // type so views don't leak each other's dataset-wide aggregate.
+ const res = await getDatasetCompilationStatus(id!, traceType);
const data = res?.data;
// The handler returns HTTP 200 with a non-zero business code for
// authorization/business errors (e.g. "no authorization"). The request
diff --git a/web/src/services/knowledge-service.ts b/web/src/services/knowledge-service.ts
index cb5593f61d..0739c11d90 100644
--- a/web/src/services/knowledge-service.ts
+++ b/web/src/services/knowledge-service.ts
@@ -377,17 +377,23 @@ export const traceIndex = (datasetId: string, indexType: string) =>
// getDatasetCompilationStatus reads the Go scheduler compile-status contract
// (GET /datasets/:id/compilation/status), used on the Go backend to
-// replace the legacy traceIndex task-progress endpoint. Route it through the
+// replace the legacy traceIndex task-progress endpoint. The `kind` query param
+// scopes the status to one compile type, mirroring the per-type scoping the
+// Python branch gets from traceIndex's `type=` param. Route it through the
// service-layer proxy (registerNextServer -> next-request) like the rest of the
// *-service.ts HTTP proxies.
const compilationStatusProxy = registerNextServer({
getDatasetCompilationStatus: {
- url: (datasetId: string) => api.compilationStatus(datasetId),
+ url: ({ datasetId }: { datasetId: string }) =>
+ api.compilationStatus(datasetId),
method: 'get',
},
} as const);
-export const getDatasetCompilationStatus = (datasetId: string) =>
- compilationStatusProxy.getDatasetCompilationStatus(datasetId);
+export const getDatasetCompilationStatus = (datasetId: string, kind: string) =>
+ compilationStatusProxy.getDatasetCompilationStatus(
+ { datasetId, params: { kind } },
+ true,
+ );
// Using RESTful API: GET /api/v1/datasets/{dataset_id}/documents
export const listDocument = (