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>
Fullscreen was broken for every render type, two root causes stacked:
- The overlay used position:fixed but rendered inside the message bubble,
whose ancestors (streaming animation transforms, chat scroll root) break
fixed positioning — inset-0 resolved against the bubble and the composer
stacked above the overlay. Render via createPortal(document.body).
- Content was fit to width only, so figures outgrew the viewport
vertically, and items-center + overflow made the top edge unreachable.
Now: m-auto centering (small content centers, oversized content scrolls
from its start edge); svg (ours + mermaid) clamps max-height and
letterboxes via the default preserveAspectRatio; Chart.js caps the
wrapper WIDTH so its own 2:1 aspect scaling lands within the viewport
(CSS-clamping the canvas would squish the bitmap). The chart wrapper's
inline maxHeight moved to .dt-chart-wrap so fullscreen can override it.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Finishes the visualize overhaul (517c90b backend + b499ba7 frontend).
- Book figure/interactive now share the chat path: deterministic local
validate_visualization, one targeted repair on failure (figure), and
GenerationFailure on residual invalidity so the book engine retries
instead of baking a broken figure/placeholder into the book.
- Delete the now-dead open-ended LLM review: pipeline.run_review and the
review prompts (review_agent.yaml keeps only repair_system/
repair_user_template). ReviewAgent's process() IS the repair pass now
(BaseAgent.process is abstract, so repair was renamed, not stubbed).
- Prompts: drop the 'split into an overview plus a detail figure' wording
that contradicted the single-<svg> policy; add a text vertical-centering
rule (y = box center, host centers via CSS) and a visual_genre fallback
line. en + zh kept in sync.
- svg-theme.css: dominant-baseline: central on .dt-svg-root text — the
host guarantees vertical centering so the model never has to emit (or
misspell) dominant-baseline itself.
- tests: replace the stale FakeReview/run_review fake with a valid-svg
no-repair path in test_capabilities_runtime.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- SvgRenderer: <img> data-URI -> sanitized inline DOM. Dependency-free
sanitizeSvg strips script/foreignObject/on*/js-urls and scopes element ids +
url()/href/aria refs so multiple inlined svgs don't collide. Multi-<svg>
content is split into independent figures.
- svg-theme.css: themed class system (t/ts/th, box/node/arr, c-* 9-ramp)
following light/dark via CSS vars and the app Geist font; svg sized width:100%
by viewBox to avoid the 300x150 inline collapse.
- HtmlRenderer: iframe height auto-fit + receives the widget's sendPrompt.
- iframe-html.ts: inject the sendPrompt bridge + a ResizeObserver height report.
Frontend visualize only — the chat page.tsx composer-prefill listener is left in
the working tree alongside the unrelated chat changes there.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Remove the user-facing entry points so /learning no longer appears in the
product, while keeping all backend logic, the /learning pages/components, and
the capability registration intact for continued development.
- SidebarShell: drop the 'Learning' nav item (+ now-unused GraduationCap icon);
left a comment documenting how to re-expose it.
- Book page: stop wiring onLearn -> remove the 'Start learning' button path and
the handleLearn handler + its learning-api imports. BookLibrary keeps its
onLearn prop + button markup so re-enabling is a one-line prop pass.
The /learning routes remain reachable by direct URL for development.
Co-Authored-By: Claude Opus 4.8 (1M context) <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>
#493 (sqlite): route _initialize() through the _connect() contextmanager
(the one remaining raw sqlite3.connect FD leak); document the auto-commit
contract so the redundant explicit commits are understood.
#529 (book):
- _strip_thinking_preamble: guard `{ not in text` before rindex() so plain
prose (refusals/errors) no longer raises ValueError -> ERROR block;
hoist json import to module top.
- llm_json: honor caller max_tokens as max(max_tokens, 2600) instead of
discarding it; bump default to 2600; fix stale 'minimal' docstring -> 'low'.
- engine.compile_page: rebuild OVERVIEW pages deterministically via
_materialize_overview_page on force, instead of running the generic LLM
compiler over hand-built intro/concept-graph/index blocks.
- kb_health.scan_log_health: key repeated-failure detection on the op, not
the free-text message, removing false positives/negatives + dead block_error.
- services/__init__: drop orphaned notebook_manager lazy-import + __all__ entry.
- PageReader.tsx: restore t() i18n on regenerate buttons; add 'Regenerating…'.
- remove PATCHES.md (developer-local scratch notes).
#484 (zulip): also match the disambiguated @**Name|user_id** mention form;
make the docstring truthful; add coverage.
#500: remove stray PR_DESCRIPTION.md committed to repo root.
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>
- Centralize Gemini 2.5/3 reasoning_effort=none in
reasoning_params.default_reasoning_effort_for so Visualize / Chat /
Solve / agentic loop stop returning empty bodies on those models.
- Visualize: per-capability max_tokens default (16k) seeded from
DEFAULT_AGENTS_SETTINGS, defensive root-tag trim on SVG/HTML output,
graceful fallback when JSON-mode review step crashes.
- Fix#485: require_auth / require_admin are async so the
set_current_user ContextVar reaches the endpoint instead of being
discarded by anyio.to_thread.run_sync's worker-thread context copy.
Adds _install_current_user helper shared by HTTP + WebSocket.
- Reasoning + native-tools chat protocol: formal content stream must
still start with FINISH/TOOL/THINK/PAUSE; tool-call deltas no longer
force-resolve labels and implicit_think_label is ignored, so
protocol-repair catches missing labels instead of mis-routing turns.
- Smooth streaming on every chat surface: useSmoothStreamText through
AssistantResponse, pin-to-bottom (useLayoutEffect) on book chat +
quiz follow-up, data-chat-scroll-root opt-in for overflow-anchor:none.
- Sidebar: collapsible Recents region with own scroll viewport,
deterministic Lucide icon per session via SessionAvatar, Docs link
next to GitHub footer, "New Chat" button removed (nav handles it).
- Add Lemonade local provider (port 13305) — registry entry, README
Docker host-gateway row, providers.md docs.
- Context-window models-endpoint probe honors DISABLE_SSL_VERIFY via
TCPConnector(ssl=False).
- README: insert v1.4.2 release row, push v1.3.10 inside "Past
releases" fold, bump install opt-in note to v1.4.2.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- _llm_writer.py: strip thinking preamble from Qwen output, remove unsupported
response_format, increase max_tokens to 2600, fix reasoning_effort 'minimal' -> 'low'
- engine.py: allow force-recompile on overview pages (previously a no-op),
add _maybe_finalize_book to regenerate_block for book status propagation
- kb_health.py: filter repeated_failures to only count error/fail log entries
- PageReader.tsx: loading spinner + disabled state on regenerate buttons
- page.tsx: error notifications via notify() for compile/regenerate failures
- layout.tsx: suppressHydrationWarning for browser extension attribute injection
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>
When the LLM/Embedding/Search settings page has no profiles configured, the UI displayed 'No profiles configured. Add a profile to start.' but provided no button to actually add one. The add-profile button was only visible inside the profile editor, which never rendered when the list was empty - creating a dead end for new users.
Add a '+ Profile' button in the empty-state view, matching the existing button style used in the profile editor.
Closes#512, Closes#505
- 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
web/lib/api.ts: defer NEXT_PUBLIC_API_BASE placeholder check from
module-load to first call. Docker bakes the literal placeholder for
runtime sed substitution, but Next.js evaluates this module during
static export of every prerendered page — the old throw failed the
admin/users page export and aborted the entire build.
Test alignment with shipped code (no behavior change):
- test_path_service: override _workspace_root alongside _project_root,
since get_memory_dir() reads workspace_root, not _user_data_dir.
- test_meta_settings: assertions now match shipped defaults
(l2_budget=20, min_chunk_chars=1000, max_chunk_chars=64000).
- test_unified_ws_turn_runtime + test_regenerate: drop emit_calls
assertions; turn_runtime doesn't emit a memory trace after chat
turns (feature was never wired up).
- test_turn_runtime_subscribe: 200 polls × 10ms instead of 20 × 0,
Python 3.14's asyncio scheduler doesn't give sleep(0) enough ticks
for the subscriber-append race.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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>
Auto capability (agents/auto/) gains a three-stage agent loop:
ANALYZING (one LLM call, streamed as thinking) -> DELEGATING (router
emits delegate_to_<cap> tool calls or atomic tool calls, with bounded
retries and a same-cap quota) -> SYNTHESIZING (final inline answer).
Sub-capability events flow through forward_events with call_id tagging
so conversation history keeps only Auto's own synthesis.
New chat-mountable tools:
- ask_user: pauses the turn for 1-3 structured questions, frontend
renders a card the user navigates and submits in one batch
- web_fetch: HTTP + readable-content extraction with strict
scheme/private-IP/size guards (pre-flight + post-redirect)
- write_note: replaces save_to_notebook; append (new record) and
edit (existing record by id) modes
- list_notebook: read-only index / drill-down listing; only mounted
when the user has notebooks
- github_query: read-only ``gh`` CLI wrapper (pr/issue/run/repo plus
GET-only api); no mutation verbs reachable
Updates chat agentic_pipeline.py + agentic_chat.yaml (en/zh) to the
new tool surface and source-inventory contract, refits
tools/builtin/__init__.py as the single place to register
chat-mounted tools and their argument-augmentation wrappers, and
tightens core stream + tool_protocol around tool-result metadata.
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>
- Rename passRate variable to masteryPercent in ModuleTree to match average mastery semantics
- Remove module name requirement from CreateModuleDialog (only KP count matters)
- Sync i18n strings for updated validation message
- 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
fetchProgress catch block logs warning instead of silently swallowing.
Submit button protected by submittingRef to prevent double-sends.
Four hardcoded English strings replaced with i18n keys.
fetchAllProgress adapted to new {summaries, errors} API format.
book/page.tsx updated for new fetchAllProgress return type.
P2-4, P2-5, P2-6
Add moduleSwitchRef set on module_changed, checked in error handler
to suppress the "Turn cancelled" error from cancel_turn. Cleared on
done so the old turn's auto-advance fires and starts the new module's
guided_learning turn.
subscribe_session re-checks for a running turn on the server, so if the
turn finishes between check_active_turn and subscribe, the page misses
the terminal done event. subscribe_turn targets the specific turn and
replays its backlog regardless of current status.
Store modulesLength, moduleSelected, currentModuleId in refs synced on
render. connect() reads refs instead of closing over state, keeping the
guard correct without adding those values as useCallback deps — which
would teardown the socket on every progress fetch or module selection.
Removing modules.length, moduleSelected, and currentModuleId from the
connect dependency array prevents the socket from closing when progress
loads multiple modules with none selected, allowing change_module to
be sent from the module picker.
- 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
Issue 1: Add waitingForLLM state — show spinner with
'Generating diagnostic questions...' text while waiting for LLM
response after WS connect, instead of silent 'Ready to start learning'.
Issue 2: Module picker — when multiple modules exist and none
selected, show module selection cards before auto-connecting WS.
Single-module books still auto-start. ModuleTree clickable after.
Issue 3: Git rm middleware.ts, git add proxy.ts (Next.js 16 compat).
92/92 tests passing.