A focused cut on top of v1.4.3:
- Skill hub: install community skills from ClawHub (and any compatible
registry via settings/skill_hubs.json) — provider abstraction in
services/skill/hub.py, new `deeptutor skill search/install/list/remove`
CLI, admin-only install endpoint for multi-user (install ≠ assign).
Every import runs a security gate: hub verdict check, zip-slip/zip-bomb
guards, text/script suffix whitelist, `always:` frontmatter stripped,
provenance recorded in .hub-lock.json.
- KB previews: new /knowledge/{kb}/file-preview-text/{filename} endpoint
serving extracted plain text; KB Files tab renders real in-browser
DOCX/XLSX previews; DOCX previewer scales pages to fit narrow panels.
- Markdown previews allow safe raster data:image URLs on <img src>
(react-markdown strips all data: URLs by default); script-capable
schemes stay blocked.
- All ten localized READMEs re-synced with the English README.
- Docs (deeptutor.info): `deeptutor skill` reference, hub-install notes on
Space and multi-user pages, KB file routes in the server API table
(en + zh).
- CLI docs contract test updated for partner/skill subcommands.
Release notes: assets/releases/ver1-4-4.md
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- telegram: send_delta via progressive edit_message_text (throttled,
flood-control retry, HTML final render, mid-stream overflow split)
- discord: send_delta via REST POST/PATCH with rate-limit retry; send()
now raises on failure so the manager retry applies
- feishu: send_delta via CardKit streaming cards (create → sequenced
stream updates → close streaming_mode, regular-card fallback)
- registry: discover_all_with_errors keeps import-failed channels
diagnosable; schema API marks them available:false with the reason;
UI grays them out and shows the missing-dependency message instead
of silently dropping them (the "why is X missing?" class of bugs)
- 10 new streaming contract tests; 343 partner tests green; tsc clean
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Security/correctness:
- Stop leaking diagnostic answers: persist a _sanitize_diagnostic() snapshot
(drops top-level answers + inline answer keys) into progress.diagnostic,
which is returned verbatim by the /progress endpoints. Grading is unaffected
(authoritative answers live in LearningStore).
- _safe_json_parse + generate_from_notebook now use the shared fence-stripping
parse_json_response instead of bare json.loads, so the common fenced/lightly
-malformed LLM output is recovered instead of silently dropped / 500'd.
Decoupling:
- unified_ws change_module: move module lookup + PRETEST reset into
LearningService.switch_module(); router keeps only the WS ordering
(module_changed before cancel) and no longer imports learning.models.
- unified_ws check_active_turn: use new public TurnRuntimeManager
.has_live_execution() instead of reaching into _lock/_executions.
- redo endpoint: LearningStore.clear_questions() instead of poking _questions_path.
- remove unused StreamEventType.USER_INPUT enum; document the WS message types.
Stability:
- LearningStore: question read-modify-write (save_question_answers/_meta),
delete(), and clear_questions() now hold _cas_lock — consistent concurrency
model; _atomic_write_text cleans up its temp file on failure.
Cleanliness/clarity:
- router: shared _validate_book_id() (9 endpoints) + _parse_modules()
(init/replace); _classify_error drops unused expected_answer param.
- guided_learning: hoist logging/RAGService imports + module logger; move tuning
constants to class top; ContextVar declared after imports.
- storage: hoist json import (7 inline copies removed).
- pocketbase_store: move _VALID_ID/_validate_id below the import block.
- rename misleading mastered_pct -> avg_mastery_pct (service + web consumers).
Frontend:
- learning [bookId] page uses lib fetchProgress (apiFetch -> auth redirect)
instead of a raw credentials fetch; track/clear the retry + auto-advance
timers on unmount; drop dead currentStage state + ModuleTree prop.
- learning-api: remove orphaned submitAnswer + AnswerRequest.
- CreateModuleDialog: use the static bookApi import; reset manualBookId to ''
to match initial state; learning list page: stop shadowing the t() translator.
Conflict-resolution carryover: dropped the PR's incidental 300s factory timeout
(kept dev's stream runner).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
New self-contained deeptutor/learning/ subsystem (models, storage, service,
scheduler, grading) + 12-stage guided_learning capability, REST router, and
web learning pages, with 164 tests.
Conflict resolutions:
- services/llm/factory.py: kept dev's stream runner (allow_image_fallback
multimodal path); dropped the PR's incidental 300s asyncio.wait_for wrapper
and its now-orphaned TimeoutError handler / unused logger — the blanket
timeout is unrelated to guided learning, dev already has consumer-side
timeouts, and 300s would truncate long legitimate streams (book/research).
- web/components/sidebar/WorkspaceSidebar.tsx: kept dev's structure, added a
useCallback handleNewChat that cancels any in-flight streaming turn before
newSession() (mirrors handleDeleteSession) and wired it to onNewChat.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Book Engine fixes for local/Qwen models: robust JSON parsing, force-recompile
now resets overview pages, regenerate_block finalizes the book, and
scan_log_health no longer flags repeated successes as failures.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fixes#481. Makes `require_auth` and `require_admin` `async def` so the user ContextVar set inside the dep is visible to async endpoints; sync deps run via `anyio.to_thread.run_sync` under `copy_context()` and the set is discarded on return.
Security: lock down the TutorBot tool sandbox (shell exec is opt-in, all
filesystem/shell access confined to the bot workspace) and isolate per-user
resources, closing #518, #517, #516, #515, #514 and #506 (first hardened in
#507).
Bug fixes: chat input disabled after the first turn (#520), KB embedding
failure on long documents (#521 / #509), profile creation under Docker
(#512 / #513), Qwen reasoning models failing native tool calling (#527 / #528),
the GPT-5 init-wizard token parameter (#508), and oversized session-event
truncation (#524).
Features: HTTP/SSE API for multi-turn chat with a specific TutorBot (#511),
multimodal image fallback for vision-capable providers without a capability
entry, safe ZIP knowledge upload, and a /settings/network page with model
fetching (community PRs #522 and #523 reimplemented locally).
Also bumps __version__ to 1.4.1, adds the v1.4.1 release notes, updates the
README Releases section, and ships the Astro + Starlight docs site under site/.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
RAG tool results can return KB document content exceeding 1MB per event,
causing the frontend TraceSurface to run out of memory when loading large
sessions. Truncate tool_result and observation payloads at 1MB in the
get_session endpoint, marking truncated events with _truncated: true.
The LLM context builder reads from a separate content-only store and
is unaffected by this truncation.
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
- Fix UnicodeEncodeError 'gbk' on Windows by setting encoding='utf-8' on
stdout/stderr reconfigure in run_server.py
- Guard Deep Research send to prevent 'settings are incomplete' crash
- Add lazy import for notebook_manager in services/__init__.py
- Add start_backend.bat with PYTHONIOENCODING=utf-8 and PYTHONUTF8=1
- Add start_frontend.bat convenience script
- Document all patches in PATCHES.md for re-apply after upstream sync
Quiz follow-up:
- New FollowupChatComposer + QuizFollowupContext let the user start a
chat thread directly from a quiz question. The composer reuses the
main ChatComposer (look, @space pickers, KB picker, attachments,
LLM selector) but routes sends through a dedicated follow-up
controller.
- New quiz_judge router + quiz-judge.ts helper power judging
follow-up answers inline.
- The older QuestionFollowupPanel.tsx is removed; QuizConfigPanel /
QuizViewer are updated to the new follow-up surface.
GeoGebra viewer:
- New Geogebra.tsx applet renderer (loaded via the official GGB
applet script) so geometry / algebra snippets can open inline
alongside chat answers. GeogebraOpenCTA + GeogebraTabContext add
the tab plumbing.
Book updates:
- book/blocks/quiz.py + book/engine.py + storage.py and the related
book components pick up the new quiz surface.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Capability infrastructure:
- New capabilities/_shared.emit_capability_result helper fills the
result envelope (label, summary, payload, render hints, UsageTracker
totals) consistently across modes.
- StatusI18n loads capability status copy from
capabilities/prompts/{en,zh}/<name>.yaml; legacy main.yaml strings
removed.
- New capabilities_settings router + service-config module power the
/settings/capabilities admin page (live capability list, defaults,
per-capability overrides).
Visualize + Animator merge:
- Visualize's AnalysisAgent now picks one of six render_types:
svg / chartjs / mermaid / html (text pipeline) or manim_video /
manim_image (Manim subprocess). The result envelope carries
render_type so the frontend delegates to the right viewer.
- math_animator capability is folded behind Visualize; the standalone
MathAnimatorConfigPanel.tsx is removed. The Animator sidebar entry
is gone, but Manim outputs and existing records remain unaffected.
Settings UI:
- /settings page split into appearance / capabilities / embedding /
llm / mcp / memory / search / status / tools tabs with a shared
layout and items index.
- New /settings/tools page lists chat-mountable tools and surfaces
availability (e.g. gh for github_query) via a new tools router.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replaces three bespoke multi-agent pipelines with orchestrators on top
of a shared agentic-engine primitive set (core/agentic/: labeled_step,
loop, tool_dispatch, usage, client). Each capability now lives in one
pipeline.py file with one pipeline.yaml prompt.
- Deep Research: Rephrase (ask_user loop) -> Decompose (OUTLINE) ->
Research blocks (THINK/TOOL/APPEND/FINISH per topic, dynamic queue
preserved) -> Reporting (OUTLINE/INTRO/SECTION/CONCLUSION).
CitationManager and the dynamic topic queue are kept.
- Deep Solve: Pre-retrieve (KB-only, QUERIES/rag/SUMMARY) -> Plan ->
per-step THINK/TOOL/FINISH/REPLAN loop with back-edge to Plan ->
Synthesize. Step FINISH text flows into the next step's context.
- Question: coordinator + pipeline replace generator / idea_agent /
models, with new history.py and mimic_source.py helpers.
Removed: research/agents/, research/research_pipeline.py,
research/prompts/{en,zh}/*.yaml (legacy multi-agent prompts);
solve/agents/, solve/memory/, solve/utils/, main_solver.py,
session_manager.py, tool_runtime.py and old prompts;
question/agents/{generator,idea_agent}.py, example.py, models.py,
old prompts; api/routers/solve.py (capability owns its own routing).
Adds shared agents/_shared/tool_composition.py for cross-pipeline
tool wiring. Updates deep_research/deep_solve/deep_question
capabilities to dispatch through the new pipelines.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replaces the flat single-blob memory page with a structured store:
- L1 captures raw run traces; L2 holds normalized document records;
L3 holds curated slots per surface (chat, notebook, book, TutorBot).
- New consolidator pipeline (chunker, guards, parse, references, runs,
modes, line-doc, meta) turns traces into versioned line-oriented
documents with stable ids and snapshot history.
- Per-user isolation flows through PathService; the store API is
stateless.
UI ships a dedicated /memory workbench with graph / L1 / L2 / L3 /
resolve subpages, plus a reusable MemorySection embedded where the
legacy panel lived.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- P1-B: Reset stage_failure_counts on LLM success in _call_llm_with_degradation
so a recovered stage is not permanently penalized by prior transient failures
- P1-A: HTML-escape notebook records (<, >, &) before embedding in
<notebook_records> XML tags to prevent prompt injection; truncate type to 50 chars
- P2-A: Remove redundant `except (Exception, asyncio.TimeoutError)` (3 places)
since Python 3.11+ TimeoutError is already a subclass of Exception
- P1-C: Add E2E flow test covering PRETEST → EXPLAIN → FEYNMAN_CHECK →
PRACTICE_QUIZ → ERROR_DIAGNOSIS → MODULE_TEST → REVIEW → COMPLETED
164 tests pass.
- Wrap user content in <notebook_records> XML tags for trust boundary
- Strengthen system prompt to explicitly treat tagged content as data
- Sanitize LLM output: strip, truncate to 200 chars, skip names < 2 chars
- Add stage_failure_counts/stage_failure_notes to LearningProgress for persistent failure tracking
- Wrap RAG retrieval with 10s independent timeout in _call_llm_impl
- Add _call_llm_with_timeout (default 60s) and _call_llm_with_degradation (bounded retry + skip)
- Apply degradation to all 12 stage handlers with stage-specific fallback paths
- Extract _run_interactive_quiz_loop shared helper for practice/practice_quiz
- Extract StructuredStageContent component from page.tsx
- Add TypeError to JSON parse except clauses across 7 files
- Simplify _record_attempt_and_update_mastery to single save exit
- Move import logging to module top in service.py
Reorder change_module handler: send module_changed first, then cancel
the active turn, then save progress. This ensures the frontend processes
the module switch before receiving any cancellation error, preventing
the UI from getting stuck on a "Turn cancelled" dead end.
The WS change_module path cancels active turns to prevent stale
progress overwrites, but the HTTP /replace-modules endpoint was
missing this protection. A concurrent turn's finally block could
restore old modules after replacement.
- Add replace_modules() that cleans stale KP state (mastery, repetition, errors, feynman)
- Rename init_modules to merge_modules, keep alias for backward compat
- Add /replace-modules API endpoint for full module replacement
- Add check_active_turn WS message handler returning turn_id + status
- Frontend sends check_active_turn on connect instead of start_turn
- If active turn exists, subscribe_session to resume; otherwise start_turn
- Add modules.length, moduleSelected, currentModuleId to connect() useCallback deps
- Add version field to LearningProgress and CAS save to LearningStore
- Cancel active turn before change_module (await task completion)
- Clear pending auto-advance timer on module_changed event