Skip to content

DeepTutor: Lifelong Personalized Tutoring. https://deeptutor.info/.

feat(knowledge): make indexing progress lines translatable

Bingxi Zhao (Frank)10297532b5ab
diff --git a/deeptutor/api/routers/knowledge.py b/deeptutor/api/routers/knowledge.py
index f3a247df9..3c2572710 100644
--- a/deeptutor/api/routers/knowledge.py
+++ b/deeptutor/api/routers/knowledge.py
@@ -862,7 +862,7 @@ async def run_initialization_task(initializer: KnowledgeBaseInitializer, task_id
initializer.progress_tracker.update(
ProgressStage.COMPLETED,
- "Knowledge base initialization complete!",
+ message_key="Knowledge base initialization complete!",
current=1,
total=1,
indexed_count=indexed_count,
@@ -925,7 +925,8 @@ async def run_initialization_task(initializer: KnowledgeBaseInitializer, task_id
if initializer.progress_tracker:
initializer.progress_tracker.update(
ProgressStage.ERROR,
- f"Initialization failed: {error_msg}",
+ message_key="Initialization failed: {{error}}",
+ message_params={"error": error_msg},
error=error_msg,
**failure_metadata,
)
@@ -965,7 +966,8 @@ async def run_upload_processing_task(
_task_log(task_id, f"Processing {len(uploaded_file_paths)} file(s) for KB '{kb_name}'")
progress_tracker.update(
ProgressStage.PROCESSING_DOCUMENTS,
- f"Validating {len(uploaded_file_paths)} file(s)...",
+ message_key="Validating {{count}} file(s)...",
+ message_params={"count": len(uploaded_file_paths)},
current=0,
total=len(uploaded_file_paths),
)
@@ -991,7 +993,8 @@ async def run_upload_processing_task(
_task_log(task_id, f"Staged {len(staged_files)} new file(s)")
progress_tracker.update(
ProgressStage.PROCESSING_DOCUMENTS,
- f"Staged {len(staged_files)} new file(s)",
+ message_key="Staged {{count}} new file(s)",
+ message_params={"count": len(staged_files)},
current=0,
total=len(staged_files),
)
@@ -1000,7 +1003,7 @@ async def run_upload_processing_task(
_task_log(task_id, "No new files to process (all duplicates or invalid)")
progress_tracker.update(
ProgressStage.COMPLETED,
- "No new files to process (all duplicates or invalid)",
+ message_key="No new files to process (all duplicates or invalid)",
current=0,
total=0,
)
@@ -1029,7 +1032,8 @@ async def run_upload_processing_task(
)
progress_tracker.update(
ProgressStage.ERROR,
- f"Processing failed: {error_msg}",
+ message_key="Processing failed: {{error}}",
+ message_params={"error": error_msg},
current=index_result.processed_count,
total=len(staged_files),
error=error_msg,
@@ -1049,7 +1053,7 @@ async def run_upload_processing_task(
progress_tracker.update(
ProgressStage.PROCESSING_DOCUMENTS,
- "Saving metadata...",
+ message_key="Saving metadata...",
current=index_result.processed_count,
total=len(staged_files),
)
@@ -1070,7 +1074,8 @@ async def run_upload_processing_task(
num_processed = index_result.processed_count
progress_tracker.update(
ProgressStage.COMPLETED,
- f"Successfully processed {num_processed} files!",
+ message_key="Successfully processed {{count}} files!",
+ message_params={"count": num_processed},
current=num_processed,
total=num_processed,
indexed_count=num_processed,
@@ -1098,7 +1103,8 @@ async def run_upload_processing_task(
progress_tracker.update(
ProgressStage.ERROR,
- f"Processing failed: {error_msg}",
+ message_key="Processing failed: {{error}}",
+ message_params={"error": error_msg},
error=error_msg,
**failure_metadata,
)
@@ -2707,7 +2713,8 @@ async def create_knowledge_base(
progress_tracker.update(
ProgressStage.PROCESSING_DOCUMENTS,
- f"Saved {len(uploaded_files)} files, preparing to process...",
+ message_key="Saved {{count}} files, preparing to process...",
+ message_params={"count": len(uploaded_files)},
current=0,
total=len(uploaded_files),
)
@@ -2766,7 +2773,8 @@ async def run_reindex_task(kb_name: str, base_dir: str, task_id: str, signature_
progress_tracker.task_id = task_id
progress_tracker.update(
ProgressStage.PROCESSING_DOCUMENTS,
- f"Re-indexing {len(file_paths)} document(s) with the active embedding model...",
+ message_key="Re-indexing {{count}} document(s) with the active embedding model...",
+ message_params={"count": len(file_paths)},
current=0,
total=len(file_paths),
)
@@ -2781,7 +2789,8 @@ async def run_reindex_task(kb_name: str, base_dir: str, task_id: str, signature_
def _on_progress(batch_num: int, total_batches: int) -> None:
progress_tracker.update(
ProgressStage.PROCESSING_DOCUMENTS,
- f"Embedding batches: {batch_num}/{total_batches}",
+ message_key="Embedding batches: {{current}}/{{total}}",
+ message_params={"current": batch_num, "total": total_batches},
current=batch_num,
total=total_batches,
)
diff --git a/deeptutor/knowledge/add_documents.py b/deeptutor/knowledge/add_documents.py
index 7ea68cbba..315d0be0c 100644
--- a/deeptutor/knowledge/add_documents.py
+++ b/deeptutor/knowledge/add_documents.py
@@ -312,7 +312,8 @@ class DocumentAdder:
self.progress_tracker.update(
ProgressStage.PROCESSING_FILE,
- f"Indexing {doc_file.name}",
+ message_key="Indexing {{name}}",
+ message_params={"name": doc_file.name},
current=len(processed_files),
total=total_files,
)
@@ -329,7 +330,8 @@ class DocumentAdder:
if self.progress_tracker is not None:
self.progress_tracker.update(
ProgressStage.PROCESSING_FILE,
- f"Indexed {doc_file.name}",
+ message_key="Indexed {{name}}",
+ message_params={"name": doc_file.name},
current=len(processed_files),
total=total_files,
)
diff --git a/deeptutor/knowledge/initializer.py b/deeptutor/knowledge/initializer.py
index feddc126a..40feed435 100644
--- a/deeptutor/knowledge/initializer.py
+++ b/deeptutor/knowledge/initializer.py
@@ -149,7 +149,8 @@ class KnowledgeBaseInitializer:
self.progress_tracker.update(
ProgressStage.PROCESSING_DOCUMENTS,
- f"Starting to process documents with {provider} provider...",
+ message_key="Starting to process documents with {{provider}} provider...",
+ message_params={"provider": provider},
current=0,
total=0,
)
@@ -161,14 +162,15 @@ class KnowledgeBaseInitializer:
if not doc_files:
self.progress_tracker.update(
ProgressStage.ERROR,
- "No documents found to process",
+ message_key="No documents found to process",
error="No documents found",
)
raise ValueError("No documents found to process")
self.progress_tracker.update(
ProgressStage.PROCESSING_DOCUMENTS,
- f"Found {len(doc_files)} documents, starting to process...",
+ message_key="Found {{count}} documents, starting to process...",
+ message_params={"count": len(doc_files)},
current=0,
total=len(doc_files),
)
@@ -182,7 +184,8 @@ class KnowledgeBaseInitializer:
def _on_progress(batch_num, total_batches):
self.progress_tracker.update(
ProgressStage.PROCESSING_DOCUMENTS,
- f"Embedding batches: {batch_num}/{total_batches} complete",
+ message_key="Embedding batches: {{current}}/{{total}} complete",
+ message_params={"current": batch_num, "total": total_batches},
current=batch_num,
total=total_batches,
)
@@ -190,7 +193,8 @@ class KnowledgeBaseInitializer:
def _on_image_progress(current: int, total: int):
self.progress_tracker.update(
ProgressStage.PROCESSING_DOCUMENTS,
- f"Describing images: {current}/{total}",
+ message_key="Describing images: {{current}}/{{total}}",
+ message_params={"current": current, "total": total},
current=current,
total=total,
)
@@ -205,7 +209,7 @@ class KnowledgeBaseInitializer:
if not success:
self.progress_tracker.update(
ProgressStage.ERROR,
- "Document processing failed",
+ message_key="Document processing failed",
error="RAG pipeline returned failure",
)
raise RuntimeError("RAG pipeline returned failure")
@@ -213,7 +217,7 @@ class KnowledgeBaseInitializer:
self._update_metadata_with_provider(provider)
self.progress_tracker.update(
ProgressStage.PROCESSING_DOCUMENTS,
- "Documents processed successfully",
+ message_key="Documents processed successfully",
current=len(doc_files),
total=len(doc_files),
)
@@ -222,7 +226,7 @@ class KnowledgeBaseInitializer:
logger.error(f"Error processing documents: {error_msg}")
self.progress_tracker.update(
ProgressStage.ERROR,
- "Failed to process documents",
+ message_key="Failed to process documents",
error=error_msg,
)
raise
diff --git a/deeptutor/knowledge/progress_tracker.py b/deeptutor/knowledge/progress_tracker.py
index a5b1ad7da..a9923935d 100644
--- a/deeptutor/knowledge/progress_tracker.py
+++ b/deeptutor/knowledge/progress_tracker.py
@@ -21,6 +21,22 @@ def _logger_instance():
return _logger
+def render_message_template(template: str, params: dict[str, object]) -> str:
+ """Fill an i18next-style ``{{name}}`` template with *params*.
+
+ Progress lines are shown verbatim in the web log box, so they have to be
+ translatable — but the backend has no viewer language (indexing runs as a
+ detached task, and the language of record lives in the browser). So the
+ wire carries the English template plus its values and the frontend renders
+ it with ``t()``; this produces the English fallback for every other
+ consumer, from the same single string.
+ """
+ text = template
+ for name, value in params.items():
+ text = text.replace("{{" + name + "}}", str(value))
+ return text
+
+
class ProgressStage(Enum):
"""Initialization stage"""
@@ -118,6 +134,10 @@ class ProgressTracker:
"indexed_count": progress.get("indexed_count"),
"index_changed": progress.get("index_changed"),
"index_action": progress.get("index_action"),
+ # Carried alongside the rendered English so a page reload
+ # can still translate the last line it shows.
+ "message_key": progress.get("message_key"),
+ "message_params": progress.get("message_params"),
},
)
except Exception as e:
@@ -145,8 +165,19 @@ class ProgressTracker:
indexed_count: int | None = None,
index_changed: bool | None = None,
index_action: str | None = None,
+ message_key: str | None = None,
+ message_params: dict[str, object] | None = None,
):
- """Update progress"""
+ """Update progress.
+
+ Pass ``message_key`` (an English ``{{name}}`` template) plus
+ ``message_params`` instead of a pre-formatted ``message`` so the web log
+ box can translate the line; ``message`` is then rendered from the same
+ template for every consumer that has no i18n of its own.
+ """
+ params = message_params or {}
+ if message_key and not message:
+ message = render_message_template(message_key, params)
progress = {
"kb_name": self.kb_name,
"task_id": self.task_id,
@@ -164,6 +195,9 @@ class ProgressTracker:
progress["index_changed"] = index_changed
if index_action:
progress["index_action"] = index_action
+ if message_key:
+ progress["message_key"] = message_key
+ progress["message_params"] = params
if error:
progress["error"] = error
diff --git a/tests/api/test_knowledge_router.py b/tests/api/test_knowledge_router.py
index bf4789528..1f73ea932 100644
--- a/tests/api/test_knowledge_router.py
+++ b/tests/api/test_knowledge_router.py
@@ -1842,7 +1842,16 @@ def test_upload_progress_counts_completed_files_and_reports_reliable_stages(
original_update = knowledge_router_module.ProgressTracker.update
def _record_update(self, stage, message="", current=0, total=0, **kwargs):
- updates.append((message, current, total))
+ # Producers name a template plus its values so the web log box can
+ # translate; record the line a consumer actually sees, which is what
+ # this test is about.
+ from deeptutor.knowledge.progress_tracker import render_message_template
+
+ key = kwargs.get("message_key")
+ rendered = message or (
+ render_message_template(key, kwargs.get("message_params") or {}) if key else ""
+ )
+ updates.append((rendered, current, total))
return original_update(
self,
stage,
diff --git a/tests/knowledge/test_progress_tracker.py b/tests/knowledge/test_progress_tracker.py
index b9ce062b9..f7d66036a 100644
--- a/tests/knowledge/test_progress_tracker.py
+++ b/tests/knowledge/test_progress_tracker.py
@@ -79,3 +79,43 @@ def test_progress_tracker_persists_structured_failure_metadata(tmp_path) -> None
assert status is not None
assert status["progress"]["error_code"] == "graphrag_model_incompatible"
assert status["progress"]["retryable"] is False
+
+
+def test_update_carries_a_translatable_template(tmp_path) -> None:
+ """Progress lines render in the browser, which is where the language is.
+
+ So the payload carries the English template plus its values; ``message``
+ stays populated for every consumer that has no i18n of its own, rendered
+ from that same template rather than duplicated at the call site.
+ """
+ from deeptutor.knowledge.progress_tracker import ProgressStage, ProgressTracker
+
+ seen: list[dict] = []
+ tracker = ProgressTracker("kb", tmp_path)
+ tracker.set_callback(seen.append)
+
+ tracker.update(
+ ProgressStage.PROCESSING_DOCUMENTS,
+ message_key="Describing images: {{current}}/{{total}}",
+ message_params={"current": 3, "total": 7},
+ current=3,
+ total=7,
+ )
+
+ payload = seen[-1]
+ assert payload["message_key"] == "Describing images: {{current}}/{{total}}"
+ assert payload["message_params"] == {"current": 3, "total": 7}
+ assert payload["message"] == "Describing images: 3/7"
+
+
+def test_update_keeps_an_explicit_message_verbatim(tmp_path) -> None:
+ from deeptutor.knowledge.progress_tracker import ProgressStage, ProgressTracker
+
+ seen: list[dict] = []
+ tracker = ProgressTracker("kb", tmp_path)
+ tracker.set_callback(seen.append)
+
+ tracker.update(ProgressStage.INITIALIZING, "already rendered")
+
+ assert seen[-1]["message"] == "already rendered"
+ assert "message_key" not in seen[-1]
diff --git a/web/hooks/useKnowledgeProgress.ts b/web/hooks/useKnowledgeProgress.ts
index 34fb1b91a..2ee0aa176 100644
--- a/web/hooks/useKnowledgeProgress.ts
+++ b/web/hooks/useKnowledgeProgress.ts
@@ -2,7 +2,12 @@
import { useCallback, useEffect, useRef, useState } from "react";
import { apiUrl, wsUrl } from "@/lib/api";
-import { taskFailureMessage, type ProgressInfo } from "@/lib/knowledge-helpers";
+import {
+ progressMessage,
+ taskFailureMessage,
+ type ProgressInfo,
+} from "@/lib/knowledge-helpers";
+import { useTranslation } from "react-i18next";
export type TaskKind = "create" | "upload" | "reindex" | "retry";
@@ -27,10 +32,12 @@ export function taskStateAfterProgress(
current: TaskState,
expectedTaskId: string | undefined,
progress: ProgressInfo,
+ /** Defaults to the key itself, i.e. the untranslated English. */
+ t: (key: string, options?: Record<string, unknown>) => string = (key) => key,
): TaskState {
const taskId = expectedTaskId || progress.task_id;
if (taskId && current.taskId !== taskId) return current;
- const logs = appendTaskLog(current.logs, progress.message);
+ const logs = appendTaskLog(current.logs, progressMessage(progress, t));
if (progress.stage === "completed") {
return { ...current, logs, executing: false, error: null };
}
@@ -39,7 +46,7 @@ export function taskStateAfterProgress(
...current,
logs,
executing: false,
- error: progress.error || progress.message || "Task failed",
+ error: progress.error || progressMessage(progress, t) || "Task failed",
errorCode: progress.error_code,
retryable: progress.retryable,
};
@@ -60,6 +67,9 @@ interface UseKnowledgeProgressOptions {
}
export function useKnowledgeProgress(options?: UseKnowledgeProgressOptions) {
+ // Progress lines arrive as English templates plus values; this hook is the
+ // first place that knows the viewer's language.
+ const { t } = useTranslation();
const onCompleteRef = useRef(options?.onComplete);
const onTaskSettledRef = useRef(options?.onTaskSettled);
useEffect(() => {
@@ -148,6 +158,7 @@ export function useKnowledgeProgress(options?: UseKnowledgeProgressOptions) {
current,
expectedTaskId,
progress,
+ t,
);
if (finalState === current) return prev;
const startedAt =
@@ -182,7 +193,7 @@ export function useKnowledgeProgress(options?: UseKnowledgeProgressOptions) {
delete socketsRef.current[kbName];
};
},
- [closeSocket, closeSource, setProgress],
+ [closeSocket, closeSource, setProgress, t],
);
const openTaskStream = useCallback(
@@ -248,11 +259,12 @@ export function useKnowledgeProgress(options?: UseKnowledgeProgressOptions) {
// "Embedding batches: N/M" stream into the log box live (not only at
// completion). Dedupe against the last line: process_log may already
// have emitted the same message via _task_log.
- if (payload.message) {
+ const line = progressMessage(payload, t);
+ if (line) {
setTasksByKb((prev) => {
const current = prev[kbName];
if (!current || current.taskId !== taskId) return prev;
- const logs = appendTaskLog(current.logs, payload.message);
+ const logs = appendTaskLog(current.logs, line);
if (logs === current.logs) return prev;
return {
...prev,
@@ -346,7 +358,7 @@ export function useKnowledgeProgress(options?: UseKnowledgeProgressOptions) {
// authoritative terminal-state fallback while SSE reconnects.
};
},
- [closeSource, setProgress],
+ [closeSource, setProgress, t],
);
const startTask = useCallback(
diff --git a/web/lib/knowledge-helpers.ts b/web/lib/knowledge-helpers.ts
index 7dc2f99ba..400195563 100644
--- a/web/lib/knowledge-helpers.ts
+++ b/web/lib/knowledge-helpers.ts
@@ -42,7 +42,11 @@ export function uploadPolicyForProvider(
export interface ProgressInfo {
task_id?: string;
stage?: string;
+ /** Rendered English. Prefer `progressMessage()`, which translates. */
message?: string;
+ /** English `{{name}}` template the backend formatted `message` from. */
+ message_key?: string;
+ message_params?: Record<string, string | number>;
current?: number;
total?: number;
percent?: number;
@@ -55,6 +59,22 @@ export interface ProgressInfo {
retryable?: boolean;
}
+/**
+ * The progress line to show, translated when the backend named its template.
+ *
+ * Indexing runs detached from any request, so the backend has no viewer
+ * language and sends the English template plus its values; `t()` is where the
+ * language is actually known. Falls back to the rendered English for progress
+ * emitted before a producer was converted.
+ */
+export function progressMessage(
+ progress: Pick<ProgressInfo, "message" | "message_key" | "message_params">,
+ t: (key: string, options?: Record<string, unknown>) => string,
+): string | undefined {
+ if (!progress.message_key) return progress.message;
+ return t(progress.message_key, progress.message_params ?? {});
+}
+
export interface KnowledgeIndexFailure {
code?: string;
message?: string;
diff --git a/web/locales/en/app.json b/web/locales/en/app.json
index 039293018..741c9122c 100644
--- a/web/locales/en/app.json
+++ b/web/locales/en/app.json
@@ -1301,6 +1301,27 @@
"Retry indexing from the documents already stored in this knowledge base.": "Retry indexing from the documents already stored in this knowledge base.",
"Re-index": "Re-index",
"Re-indexing…": "Re-indexing…",
+ "Starting to process documents with {{provider}} provider...": "Starting to process documents with {{provider}} provider...",
+ "Found {{count}} documents, starting to process...": "Found {{count}} documents, starting to process...",
+ "No documents found to process": "No documents found to process",
+ "Validating {{count}} file(s)...": "Validating {{count}} file(s)...",
+ "Staged {{count}} new file(s)": "Staged {{count}} new file(s)",
+ "Saved {{count}} files, preparing to process...": "Saved {{count}} files, preparing to process...",
+ "No new files to process (all duplicates or invalid)": "No new files to process (all duplicates or invalid)",
+ "Re-indexing {{count}} document(s) with the active embedding model...": "Re-indexing {{count}} document(s) with the active embedding model...",
+ "Indexing {{name}}": "Indexing {{name}}",
+ "Indexed {{name}}": "Indexed {{name}}",
+ "Describing images: {{current}}/{{total}}": "Describing images: {{current}}/{{total}}",
+ "Embedding batches: {{current}}/{{total}}": "Embedding batches: {{current}}/{{total}}",
+ "Embedding batches: {{current}}/{{total}} complete": "Embedding batches: {{current}}/{{total}} complete",
+ "Saving metadata...": "Saving metadata...",
+ "Documents processed successfully": "Documents processed successfully",
+ "Successfully processed {{count}} files!": "Successfully processed {{count}} files!",
+ "Knowledge base initialization complete!": "Knowledge base initialization complete!",
+ "Document processing failed": "Document processing failed",
+ "Failed to process documents": "Failed to process documents",
+ "Initialization failed: {{error}}": "Initialization failed: {{error}}",
+ "Processing failed: {{error}}": "Processing failed: {{error}}",
"Retry indexing": "Retry indexing",
"Retrying…": "Retrying…",
"Active embedding's index version exists but is empty — last re-index probably failed.": "Active embedding's index version exists but is empty — last re-index probably failed.",
diff --git a/web/locales/zh/app.json b/web/locales/zh/app.json
index 50aeb2d83..afb9b8bdb 100644
--- a/web/locales/zh/app.json
+++ b/web/locales/zh/app.json
@@ -1421,6 +1421,27 @@
"Retry indexing from the documents already stored in this knowledge base.": "使用此知识库中已经保存的文档重试索引。",
"Re-index": "重建索引",
"Re-indexing…": "正在重建索引…",
+ "Starting to process documents with {{provider}} provider...": "正在使用 {{provider}} 引擎处理文档…",
+ "Found {{count}} documents, starting to process...": "找到 {{count}} 个文档,开始处理…",
+ "No documents found to process": "没有找到可处理的文档",
+ "Validating {{count}} file(s)...": "正在校验 {{count}} 个文件…",
+ "Staged {{count}} new file(s)": "已暂存 {{count}} 个新文件",
+ "Saved {{count}} files, preparing to process...": "已保存 {{count}} 个文件,准备处理…",
+ "No new files to process (all duplicates or invalid)": "没有需要处理的新文件(全部重复或无效)",
+ "Re-indexing {{count}} document(s) with the active embedding model...": "正在用当前向量模型重建 {{count}} 个文档的索引…",
+ "Indexing {{name}}": "正在索引 {{name}}",
+ "Indexed {{name}}": "已索引 {{name}}",
+ "Describing images: {{current}}/{{total}}": "图片描述:{{current}}/{{total}}",
+ "Embedding batches: {{current}}/{{total}}": "向量化批次:{{current}}/{{total}}",
+ "Embedding batches: {{current}}/{{total}} complete": "向量化批次:{{current}}/{{total}} 已完成",
+ "Saving metadata...": "正在保存元数据…",
+ "Documents processed successfully": "文档处理完成",
+ "Successfully processed {{count}} files!": "成功处理 {{count}} 个文件!",
+ "Knowledge base initialization complete!": "知识库初始化完成!",
+ "Document processing failed": "文档处理失败",
+ "Failed to process documents": "处理文档失败",
+ "Initialization failed: {{error}}": "初始化失败:{{error}}",
+ "Processing failed: {{error}}": "处理失败:{{error}}",
"Retry indexing": "重试索引",
"Retrying…": "正在重试…",
"Active embedding's index version exists but is empty — last re-index probably failed.": "当前激活 embedding 的索引版本存在但为空——上次重建索引可能失败了。",
diff --git a/web/tests/knowledge-progress.test.ts b/web/tests/knowledge-progress.test.ts
index b80a36d15..bc642bc09 100644
--- a/web/tests/knowledge-progress.test.ts
+++ b/web/tests/knowledge-progress.test.ts
@@ -46,3 +46,33 @@ test("progress from another task cannot overwrite current state", () => {
running,
);
});
+
+test("translates a templated progress line and falls back without one", () => {
+ const t = (key: string, options?: Record<string, unknown>) =>
+ key === "Describing images: {{current}}/{{total}}"
+ ? `图片描述:${options?.current}/${options?.total}`
+ : key;
+
+ const translated = taskStateAfterProgress(
+ { ...running, logs: [] },
+ "task-1",
+ {
+ task_id: "task-1",
+ stage: "processing_documents",
+ message: "Describing images: 3/7",
+ message_key: "Describing images: {{current}}/{{total}}",
+ message_params: { current: 3, total: 7 },
+ },
+ t,
+ );
+ assert.deepEqual(translated.logs, ["图片描述:3/7"]);
+
+ // A producer that has not been converted still shows its rendered English.
+ const legacy = taskStateAfterProgress(
+ { ...running, logs: [] },
+ "task-1",
+ { task_id: "task-1", stage: "processing_documents", message: "Saving…" },
+ t,
+ );
+ assert.deepEqual(legacy.logs, ["Saving…"]);
+});