Skip to content

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

Merge codex/immersive-reading-v2 into dev

Bingxi Zhao (Frank)9e54429426f9
diff --cc tests/services/session/test_sqlite_store.py
index 969e5fd40,799a120a2..95391be07
--- a/tests/services/session/test_sqlite_store.py
+++ b/tests/services/session/test_sqlite_store.py
@@@ -76,25 -76,27 +76,46 @@@ def _make_items(*specs)
return items
+def test_get_session_summaries_batches_counts_and_latest_visible_message(
+ store: SQLiteSessionStore,
+) -> None:
+ first = asyncio.run(store.create_session(title="First", session_id="session-1"))
+ second = asyncio.run(store.create_session(title="Second", session_id="session-2"))
+ asyncio.run(store.add_message(first["id"], "system", "private setup"))
+ asyncio.run(store.add_message(first["id"], "user", "First question"))
+ asyncio.run(store.add_message(first["id"], "assistant", "Latest answer"))
+ asyncio.run(store.add_message(second["id"], "system", "system only"))
+
+ summaries = asyncio.run(store.get_session_summaries([first["id"], second["id"], first["id"]]))
+ by_id = {summary["session_id"]: summary for summary in summaries}
+
+ assert by_id[first["id"]]["message_count"] == 2
+ assert by_id[first["id"]]["last_message"] == "Latest answer"
+ assert by_id[second["id"]]["message_count"] == 0
+ assert by_id[second["id"]]["last_message"] == ""
+
+
+ def test_generic_history_excludes_immersive_reading_sessions(
+ store: SQLiteSessionStore,
+ ) -> None:
+ chat = asyncio.run(store.create_session(title="Regular chat"))
+ reading = asyncio.run(store.create_session(title="Reading conversation"))
+ asyncio.run(
+ store.update_session_preferences(
+ reading["id"],
+ {
+ "session_kind": "immersive_reading",
+ "reading_workspace_id": "rw_private",
+ },
+ )
+ )
+
+ listed = asyncio.run(store.list_sessions())
+
+ assert [row["id"] for row in listed] == [chat["id"]]
+ assert asyncio.run(store.get_session(reading["id"])) is not None
+
+
# ── Notebook entries ──────────────────────────────────────────────
diff --cc web/app/(workspace)/home/[[...sessionId]]/page.tsx
index 344e079ad,021332af9..3df63ec9d
--- a/web/app/(workspace)/home/[[...sessionId]]/page.tsx
+++ b/web/app/(workspace)/home/[[...sessionId]]/page.tsx
@@@ -312,16 -312,17 +312,27 @@@ const CAPABILITIES: CapabilityDef[] =
allowedTools: [],
defaultTools: [],
},
+ {
+ value: "immersive_reading",
+ label: "Immersive Reading",
+ description: "Read a document with the assistant, cited line by line",
+ icon: BookOpenText,
+ // The five reading tools auto-mount server-side once a document is open;
+ // these are the extra tools the assistant may also reach for while reading.
+ allowedTools: ["web_search", "code_execution", "reason"],
+ defaultTools: [],
+ },
+ {
+ value: "mastery_path",
+ label: "Mastery Path",
+ description: "Mastery-based tutoring with a hard gate",
+ icon: GraduationCap,
+ // The mastery tools (status/quiz/grade/assess/build) auto-mount server-side
+ // when this capability is active; rag auto-mounts when a KB is attached.
+ // These are only the extra optional tools the tutor may also reach for.
+ allowedTools: ["web_search", "code_execution"],
+ defaultTools: [],
+ },
];
interface KnowledgeBase {
diff --cc web/components/sidebar/SidebarShell.tsx
index 4549bc4f1,fb773bed9..1eaf1cdc4
--- a/web/components/sidebar/SidebarShell.tsx
+++ b/web/components/sidebar/SidebarShell.tsx
@@@ -87,13 -86,13 +87,20 @@@ const PRIMARY_NAV: NavEntry[] =
tooltipKey: "Book tooltip",
requires: "llm",
},
+ {
+ href: "/space/learning",
+ label: "Mastery Path",
+ icon: Route,
+ tooltipKey: "Learn through a living mastery map",
+ requires: "llm",
+ },
+ {
+ href: "/reading",
+ label: "Immersive Reading",
+ icon: BookText,
+ tooltipKey: "Immersive Reading tooltip",
+ requires: "llm",
+ },
{
href: "/space",
label: "Learning Space",