DeepTutor: Lifelong Personalized Tutoring. https://deeptutor.info/.
Python ai-agentsai-tutorclawbotcli-tooldeepresearchinteractive-learninglearningmulti-agent-systemsrag
release: v1.5.4
Bingxi Zhao (Frank)d068519de8f9
diff --git a/README.md b/README.mdindex 07cbdb4b6..154f621b7 100644--- a/README.md+++ b/README.md@@ -48,6 +48,8 @@### 📦 Releases+> **[2026.7.24]** [v1.5.4](https://github.com/HKUDS/DeepTutor/releases/tag/v1.5.4) — Maintenance sweep: the post-answer "generating" stall is gone, IM partners render Markdown tables faithfully, LLM JSON parsing is sturdier, plus quiz, create-KB form, and Math Animator fixes.+> **[2026.7.24]** [v1.5.3](https://github.com/HKUDS/DeepTutor/releases/tag/v1.5.3) — Themeable code blocks, four more coding CLIs in My Agents (Gemini, Kimi, opencode, MiMo), an Atlas Cloud LLM provider, and a broad chat, memory, embedding, and parsing reliability sweep.> **[2026.7.19]** [v1.5.2](https://github.com/HKUDS/DeepTutor/releases/tag/v1.5.2) — Configurable chat attachment limits, PageIndex retrieval that reasons across your documents via agentic tool calls, broader Anthropic/OpenAI model support, and steadier Book, Knowledge Base, and chat UI.diff --git a/assets/releases/ver1-5-4.md b/assets/releases/ver1-5-4.mdnew file mode 100644index 000000000..e8c3138d8--- /dev/null+++ b/assets/releases/ver1-5-4.md@@ -0,0 +1,32 @@+# DeepTutor v1.5.4 Release Notes++**Release Date:** 2026.07.24++A same-day maintenance follow-up to [v1.5.3](ver1-5-3.md), focused on how chat feels: the post-answer "generating" stall is gone, IM partners render Markdown tables faithfully, and the JSON that models hand back parses more robustly. Drop-in — no migrations.++## What's New++### Chat responsiveness++- The seconds-long "generating…" stall after an answer finished streaming is eliminated: the turn's completion event now carries the persisted message ids so the frontend reconciles them in place instead of refetching and re-rendering the whole session, turn events flush in one transaction ([#678](https://github.com/HKUDS/DeepTutor/issues/678)), and the streaming autoscroll no longer forces a layout every frame.+- Pressing Enter while the assistant is still streaming no longer fires a second, interleaved message ([#674](https://github.com/HKUDS/DeepTutor/issues/674)).++### Faithful IM tables++Markdown-table handling is unified across partner channels, fixing empty cells dropped from Slack ([#679](https://github.com/HKUDS/DeepTutor/issues/679)) and Feishu ([#683](https://github.com/HKUDS/DeepTutor/issues/683)) tables and empty rows misread as header separators ([#682](https://github.com/HKUDS/DeepTutor/issues/682)).++### Sturdier LLM-output parsing++Structured output survives messier model responses: `<think>` reasoning tags are stripped before parsing ([#675](https://github.com/HKUDS/DeepTutor/issues/675)), a JSON value followed by adjacent values no longer breaks Deep Research extraction ([#680](https://github.com/HKUDS/DeepTutor/issues/680)), and the parser returns the longest decodable value instead of the first prefix it finds ([#692](https://github.com/HKUDS/DeepTutor/issues/692)).++### Assorted fixes++- Quiz cards generated mid-stream are scoped to their own turn — a new quiz no longer inherits (and silently re-reports) the previous quiz's answers ([#677](https://github.com/HKUDS/DeepTutor/issues/677)).+- The create-KB form no longer loses typed input and loaded files while another knowledge base is indexing in the background ([#691](https://github.com/HKUDS/DeepTutor/issues/691)).+- Math Animator reads `500ms` as milliseconds, not minutes ([#681](https://github.com/HKUDS/DeepTutor/issues/681)).++## Upgrade Notes++Drop-in from v1.5.3: `pip install -U deeptutor`; Docker users pull `ghcr.io/hkuds/deeptutor:latest`. No migrations, no schema or config changes.++**Full Changelog**: https://github.com/HKUDS/DeepTutor/compare/v1.5.3...v1.5.4diff --git a/deeptutor/__version__.py b/deeptutor/__version__.pyindex 0e8d88be8..892e6884d 100644--- a/deeptutor/__version__.py+++ b/deeptutor/__version__.py@@ -6,6 +6,6 @@ before publishing to PyPI; the web sidebar badge and CLI banner read from thisfile directly."""-__version__ = "1.5.3"+__version__ = "1.5.4"__all__ = ("__version__",)diff --git a/deeptutor/services/session/sqlite_store.py b/deeptutor/services/session/sqlite_store.pyindex 3f7d4d72c..8ef2ebab8 100644--- a/deeptutor/services/session/sqlite_store.py+++ b/deeptutor/services/session/sqlite_store.py@@ -835,7 +835,7 @@ class SQLiteSessionStore:events: list[dict[str, Any]] | None = None,attachments: list[dict[str, Any]] | None = None,metadata: dict[str, Any] | None = None,- parent_message_id: int | None | _Unset = _PARENT_AUTO,+ parent_message_id: int | str | None | _Unset = _PARENT_AUTO,) -> int:now = time.time()with self._connect() as conn:@@ -903,7 +903,10 @@ class SQLiteSessionStore:events: list[dict[str, Any]] | None = None,attachments: list[dict[str, Any]] | None = None,metadata: dict[str, Any] | None = None,- parent_message_id: int | None | _Unset = _PARENT_AUTO,+ # ``str`` satisfies SessionStoreProtocol (PocketBase parents are string+ # record ids); on the SQLite backend a non-None parent is always the+ # integer rowid this store itself returned.+ parent_message_id: int | str | None | _Unset = _PARENT_AUTO,) -> int:return await self._run(self._add_message_sync,diff --git a/web/context/UnifiedChatContext.tsx b/web/context/UnifiedChatContext.tsxindex b1f6e42df..a66ec1e69 100644--- a/web/context/UnifiedChatContext.tsx+++ b/web/context/UnifiedChatContext.tsx@@ -623,11 +623,15 @@ function reducer(state: ProviderState, action: Action): ProviderState {// long conversations.const session = state.sessions[action.key];if (!session) return state;- const result = reconcileTurnIds(session.messages, session.selectedBranches, {- turnId: action.turnId,- userMessageId: action.userMessageId,- assistantMessageId: action.assistantMessageId,- });+ const result = reconcileTurnIds(+ session.messages,+ session.selectedBranches,+ {+ turnId: action.turnId,+ userMessageId: action.userMessageId,+ assistantMessageId: action.assistantMessageId,+ },+ );if (!result.changed) return state;return {...state,diff --git a/web/lib/turn-reconcile.ts b/web/lib/turn-reconcile.tsindex b62d46de0..71e347127 100644--- a/web/lib/turn-reconcile.ts+++ b/web/lib/turn-reconcile.ts@@ -106,8 +106,7 @@ export function reconcileTurnIds<T extends ReconcilableMessage>(if (remap.size === 0) return unchanged;const nextMessages = messages.map((message) => {- const nextId =- message.id !== undefined ? remap.get(message.id) : undefined;+ const nextId = message.id !== undefined ? remap.get(message.id) : undefined;const nextParent =message.parentMessageId != null? remap.get(message.parentMessageId)@@ -131,8 +130,9 @@ export function reconcileTurnIds<T extends ReconcilableMessage>(? undefined: remap.get(parentAsNumber);const remappedChild = remap.get(childId);- rebuilt[remappedParent !== undefined ? String(remappedParent) : parentKey] =- remappedChild !== undefined ? remappedChild : childId;+ rebuilt[+ remappedParent !== undefined ? String(remappedParent) : parentKey+ ] = remappedChild !== undefined ? remappedChild : childId;if (remappedParent !== undefined || remappedChild !== undefined) {branchesChanged = true;}@@ -140,5 +140,9 @@ export function reconcileTurnIds<T extends ReconcilableMessage>(if (branchesChanged) nextBranches = rebuilt;}- return { messages: nextMessages, selectedBranches: nextBranches, changed: true };+ return {+ messages: nextMessages,+ selectedBranches: nextBranches,+ changed: true,+ };}diff --git a/web/tests/turn-reconcile.test.ts b/web/tests/turn-reconcile.test.tsindex 005549c5e..7efebb3a8 100644--- a/web/tests/turn-reconcile.test.ts+++ b/web/tests/turn-reconcile.test.ts@@ -14,7 +14,12 @@ const TURN = "turn_abc";function optimisticTurn(): Msg[] {return [{ id: 10, role: "user", content: "earlier", parentMessageId: null },- { id: 11, role: "assistant", content: "earlier reply", parentMessageId: 10 },+ {+ id: 11,+ role: "assistant",+ content: "earlier reply",+ parentMessageId: 10,+ },{ id: -2000, role: "user", content: "question", parentMessageId: 11 },{id: -2001,@@ -28,11 +33,15 @@ function optimisticTurn(): Msg[] {test("swaps optimistic user+assistant ids and parent pointers", () => {const input = optimisticTurn();- const result = reconcileTurnIds(input, {}, {- turnId: TURN,- userMessageId: 12,- assistantMessageId: 13,- });+ const result = reconcileTurnIds(+ input,+ {},+ {+ turnId: TURN,+ userMessageId: 12,+ assistantMessageId: 13,+ },+ );assert.equal(result.changed, true);const [, , user, assistant] = result.messages;assert.equal(user.id, 12);@@ -54,11 +63,15 @@ test("does not touch rows that already carry persisted ids", () => {events: [{ turn_id: TURN }],},];- const result = reconcileTurnIds(messages, {}, {- turnId: TURN,- userMessageId: 99,- assistantMessageId: 98,- });+ const result = reconcileTurnIds(+ messages,+ {},+ {+ turnId: TURN,+ userMessageId: 99,+ assistantMessageId: 98,+ },+ );assert.equal(result.changed, false);assert.equal(result.messages, messages);});@@ -84,11 +97,15 @@ test("a stale done replay for an old turn cannot restamp a newer turn", () => {];// done replay for turn_old: its bubble already has real ids → no-op, and// crucially the newer optimistic bubble is left alone.- const result = reconcileTurnIds(messages, {}, {- turnId: "turn_old",- userMessageId: 77,- assistantMessageId: 78,- });+ const result = reconcileTurnIds(+ messages,+ {},+ {+ turnId: "turn_old",+ userMessageId: 77,+ assistantMessageId: 78,+ },+ );assert.equal(result.changed, false);});@@ -103,22 +120,30 @@ test("regenerate turns reconcile the assistant id only", () => {events: [{ turn_id: TURN }],},];- const result = reconcileTurnIds(messages, {}, {- turnId: TURN,- userMessageId: null,- assistantMessageId: 41,- });+ const result = reconcileTurnIds(+ messages,+ {},+ {+ turnId: TURN,+ userMessageId: null,+ assistantMessageId: 41,+ },+ );assert.equal(result.changed, true);assert.equal(result.messages[1].id, 41);assert.equal(result.messages[0].id, 40);});test("falls back to the last assistant bubble when turn id is missing", () => {- const result = reconcileTurnIds(optimisticTurn(), {}, {- turnId: null,- userMessageId: 12,- assistantMessageId: 13,- });+ const result = reconcileTurnIds(+ optimisticTurn(),+ {},+ {+ turnId: null,+ userMessageId: 12,+ assistantMessageId: 13,+ },+ );assert.equal(result.changed, true);assert.equal(result.messages[3].id, 13);});