558 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
e615df41ac Merge remote-tracking branch 'origin/main' into guide2.0 2026-04-20 01:03:34 +08:00
Bingxi Zhao (Frank)
7f780a8b64 Merge branch 'dev' 2026-04-20 01:01:57 +08:00
Bingxi Zhao (Frank)
9ba08be2e6 docs(readme): update README and all localized translations
Made-with: Cursor
2026-04-20 01:01:31 +08:00
Bingxi Zhao (Frank)
2745e8bde9 feat(book): introduce book capability and restructure guide/co_writer modules
- Add new `deeptutor/book/` module with multi-agent pipeline
  (ideation, spine, page planner, source explorer, synthesizer)
  and rich block system (text, code, figure, quiz, flash cards,
  callout, deep dive, timeline, animation, concept graph, etc.)
- Add `/api/routers/book.py` and `deeptutor_cli/book.py` entry points
- Add web UI under `web/app/(workspace)/book/` with sidebar,
  chat panel, page reader, spine editor, progress timeline, and
  block renderers
- Move `deeptutor/agents/co_writer` -> `deeptutor/co_writer` and
  `deeptutor/agents/guide` -> `deeptutor/guide` (then remove guide
  entirely now superseded by book)
- Remove legacy guide UI, hooks, types, and API router
- Update visualize agents/prompts, notebook service, prompt manager,
  session turn runtime, and shared services to support new flows
- Refresh chat composer, sidebar, notebook selector, and locales

Made-with: Cursor
2026-04-20 00:33:33 +08:00
Bingxi Zhao
79d830617a Merge pull request #341 from HKUDS/dev
release: v1.1.2 — CI fix & release notes cleanup
v1.1.2
2026-04-18 11:42:16 +08:00
Bingxi Zhao (Frank)
6e00642c2d fix(channels): lazy-import loguru in BaseChannel to unblock CI smoke tests
Release notes condensed for readability.

Made-with: Cursor
2026-04-18 11:41:41 +08:00
Bingxi Zhao (Frank)
c2882bc1a4 docs(readme): tighten release notes one-liners for readability
Made-with: Cursor
2026-04-18 11:36:50 +08:00
Bingxi Zhao (Frank)
100576da69 release: v1.1.2 — schema-driven channels, secret masking, RAG simplification, KB-consistency hardening
* TutorBot Channels tab is now schema-driven across every built-in & plugin channel
  (GET /api/v1/tutorbot/channels/schema), with per-field secret reveal toggles.
* Channel secrets are masked end-to-end; raw values only surface via the explicit
  ?include_secrets=true edit-form route. PATCH validates ChannelsConfig at the API
  boundary and returns 422 on bad payloads. reload_channels is serialised by an
  asyncio.Lock and records last_reload_error for the UI.
* Collapsed services/rag/ to a single LlamaIndex pipeline: removed ~2.6k lines of
  unused components/* + pipeline.py + types.py + utils/ + parsers/. rag_provider
  is now a stub; legacy values silently coerce to llamaindex.
* Centralised file routing into services/rag/file_routing.py (FileTypeRouter /
  DocumentType / FileClassification); dropped per-provider extension helpers.
* Defensive RAG/KB consistency: deep_solve / deep_research strip rag/kb when no
  KB is attached; SolveToolRuntime + ResearchPipeline + DecomposeAgent
  short-circuit instead of falling back to non-existent default KBs (DE-all,
  ai_textbook).
* Externalised AgenticChatPipeline prompts into agentic_chat.yaml (zh + en).
* Added Thai README (#337).
* New test modules: file_routing, knowledge_base_config, channel_schema,
  channel_secrets, rag_consistency, research_pipeline_rag.

Full notes: assets/releases/ver1-1-2.md

Made-with: Cursor
2026-04-18 11:33:53 +08:00
Bingxi Zhao
439630cc54 Merge pull request #337 from DoctorNasa/docs/thai-readme
docs: add Thai README documentation
2026-04-18 10:41:07 +08:00
Srinivas R Kulkarni
0166009c0b feat(tutorbot): Channels tab, Telegram UI, API channel reload, token reveal (#338)
- Return full channels on GET /tutorbot/{id}; keep list view as channel names only
- PATCH bot when stopped (disk config); PATCH running applies channels + hot-reload listeners
- Add Channels tab: delivery toggles, Telegram fields, merge-safe save, show/hide token
- Extend tutorbot router tests (GET stopped, PATCH stopped/running + reload)
2026-04-18 10:36:45 +08:00
Roongroj P
d230ae5b5b docs: add Thai README documentation
- Add assets/README/README_TH.md with full parity to English README
- Add 🇹🇭 link to main README.md language selector
- Add CLAUDE.md to .gitignore
2026-04-17 16:39:56 -05:00
Bingxi Zhao (Frank)
cfffd4bd37 Merge branch 'dev' into main: per-capability answer-now fast paths v1.1.1 2026-04-17 23:33:42 +08:00
Bingxi Zhao (Frank)
4ef783066c feat(answer-now): per-capability fast paths instead of forced chat reroute
Each capability now owns its own answer-now branch so the early-exit
respects the capability's natural output shape:

- chat            -> synthesize markdown answer (existing behavior)
- deep_solve      -> skip planning + reasoning, jump to writer
- deep_question   -> skip ideation, emit full quiz JSON in one structured call
- deep_research   -> skip rephrase/decompose/research, write report directly
- math_animator   -> skip analysis/design/summary, KEEP code-gen + render
- visualize       -> skip analysis/review, emit renderable code in one call

The orchestrator no longer rewrites answer_now turns into chat. It now
preserves active_capability and only falls back to chat when the
originally selected capability is missing from the registry.

Shared plumbing lives in deeptutor/capabilities/_answer_now.py
(extract gate, trace summary formatter, skip notice, LLM stream
wrapper, chunk joiner). Each fast-path preserves the same result
envelope so QuizViewer / MathAnimatorViewer / VisualizationViewer
render unchanged, and prepends a "Skipped X stage(s)" notice so the
user knows it was a best-effort early exit.

Frontend: handleAnswerNow no longer overrides snapshot.capability.

Tests: rewrote the orchestrator routing tests for the new contract;
added tests/capabilities/test_answer_now.py with 28 cases covering
the helpers and every per-capability fast-path (including unparseable
JSON / invalid render_type / fence-wrapped JSON recovery, and a
math_animator test that verifies analysis/design/summary are NOT
invoked while code-gen + render ARE).

Updated v1.1.1 release notes to reflect the new design.

Made-with: Cursor
2026-04-17 23:32:45 +08:00
Bingxi Zhao (Frank)
570a5ffaed Merge branch 'dev' into main for v1.1.1 2026-04-17 22:44:13 +08:00
Bingxi Zhao (Frank)
e8aa57d737 release: v1.1.1 — universal answer-now, co-writer scroll sync, notebook system unification, tutorbot config refactor
- Promote "Answer now" to a universal escape hatch via answer_now_context;
  orchestrator re-routes any capability to chat._stage_answer_now.
- Co-Writer: draggable split + persistent ratio + line-anchored
  bidirectional scroll sync using a hidden mirror for wrap-aware editor y.
- SaveToNotebookModal: optional message-selection mode with quick presets;
  rebuild transcript / userQuery from the selected subset.
- Adopt the real notebook API (/api/v1/notebook/*) across Knowledge tab,
  guide notebook picker, and save-to-notebook flow; new typed helpers in
  web/lib/notebook-api.ts (listNotebooks/getNotebook/createNotebook/...).
- Extract CollapsibleConfigSection; unify Quiz / Math Animator / Visualize
  / Deep Research panels behind one collapsed-summary header.
- Replace streaming spinner with a dedicated Stop button; persistent
  composer header; mask-gradient on messages container.
- TutorBotManager: public load/save/merge API; atomic write via temp +
  Path.replace; merge_bot_config with explicit-clear semantics; new
  tests/services/tutorbot/test_manager_config.py.
- MarkdownRenderer: trackSourceLines passes data-source-line through;
  RichCodeBlock skips Prism for unlabeled/plaintext fences; mermaid
  detection includes flow/seq/sequence editor.md fences.
- UI/theme: deeper foregrounds + warmer borders for light/Snow themes;
  /guide migrated off hardcoded slate/indigo to design tokens;
  HistorySessionPicker themed and timestamp-seconds bug fixed.
- Filter system messages out of UnifiedChatContext.hydrateMessages and
  ChatMessageList so backend grounding context never renders as a bubble.
- Bug fixes (already merged earlier in dev):
  * tutorbot config wipe on restart (#332)
  * selective_access_log middleware unpack crash (#334/#335)
  * 15 npm security vulnerabilities — jspdf/next/mermaid (#330)
- Drive-by: remove "// README" typo from .env.example_CN.
- Add v1.1.1 release notes and update README.

Made-with: Cursor
2026-04-17 22:43:52 +08:00
Bingxi Zhao
c33e165ecd Merge pull request #330 from srinivasrk/fix/npm-security-vulnerabilities
fix(web): resolve 15 npm security vulnerabilities
2026-04-17 20:06:42 +08:00
Bingxi Zhao
3575963f10 Merge pull request #335 from kagura-agent/fix/selective-access-log-unpack
fix(api): add missing http_version arg in selective_access_log middleware
2026-04-17 20:05:03 +08:00
Bingxi Zhao
1f0d8c0d6c Merge pull request #332 from srinivasrk/fix/tutorbot-config-wipe
Fix: TutorBot channel config wiped on every server restart
2026-04-17 19:56:30 +08:00
kagura-agent
1c6890290a fix(api): add missing http_version arg in selective_access_log middleware
The selective_access_log middleware uses logging.getLogger('uvicorn.access'),
which inherits uvicorn's AccessFormatter. That formatter unpacks record.args
into five values (client_addr, method, full_path, http_version, status_code),
but the middleware only passed four — omitting http_version — causing a
ValueError ('not enough values to unpack') on every non-200 response.

Add the missing http_version argument from the ASGI scope, defaulting to
'1.1' when absent.

Fixes #334

Signed-off-by: kagura-agent <kagura.chen28@gmail.com>
2026-04-17 08:18:49 +08:00
Srini
dcb7ced89a fix(tutorbot): preserve existing config when starting bot via API
The create_and_start_bot endpoint was building a fresh BotConfig with
empty defaults (channels: {}) on every call, which caused _save_bot_config
to overwrite the on-disk config.yaml and wipe user-configured channels
(e.g. Telegram) on every server restart.

Fix: load the existing config from disk first and only fall back to
request payload defaults when no existing values are present.
2026-04-15 14:28:30 -07:00
Srini
d883751cb6 fix(web): resolve 15 npm security vulnerabilities
Bumped vulnerable direct dependencies:
- jspdf ^4.0.0 → ^4.2.0: fixes critical PDF injection, XSS, and DoS (9 CVEs)
- next ^16.1.1 → ^16.2.3: fixes HTTP smuggling, CSRF bypass, and DoS (8 CVEs)
- mermaid ^11.12.2 → ^11.14.0: fixes moderate DOMPurify/parser issues
- eslint-config-next 16.1.1 → 16.2.3: kept in sync with next

Ran `npm audit fix` to patch indirect dependencies:
- flatted: prototype pollution + DoS
- lodash-es: prototype pollution + code injection
- minimatch, picomatch: ReDoS
- dompurify, ajv, brace-expansion: moderate issues

Result: 0 vulnerabilities (was 1 critical, 5 high, 9 moderate)
No breaking changes — all updates are within the same major version.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 11:33:54 -07:00
Bingxi Zhao (Frank)
727d49cf8b release: v1.1.0 — LaTeX parsing overhaul, LLM probe config, extra_headers fix, notebook UUID fix
- Rewrite LaTeX block math normalization with heuristic-based $→$$ promotion
- Move LLM diagnostic probe max_tokens from env var to agents.yaml
- Fix extra_headers merge in LLM factory complete/stream (prevents TypeError)
- Fix SaveToNotebookModal to use notebook UUIDs instead of category IDs (#301)
- Add Docker + local LLM (host.docker.internal) guidance in env/compose files
- Add tests: LaTeX, notebook router, summarize agent, LLM probe, extra_headers
- Add v1.1.0 release notes and update README

Made-with: Cursor
v1.1.0
2026-04-15 02:15:19 +08:00
Bingxi Zhao
df793a52f9 Merge pull request #321 from DarkGenius/feat/llm-test-max-tokens
feat(diagnostics): make LLM probe max_tokens configurable via env
2026-04-15 01:54:34 +08:00
Bingxi Zhao
aca30ca82f Merge pull request #323 from sagnikonly/fix/latex-rendering
merge: latex rendering improvements from #323
2026-04-15 01:40:49 +08:00
sagnikonly
a2808cf7be fix(web): improve robust parsing for LaTeX block math 2026-04-14 20:52:20 +05:30
Roman Barlos
245d6ca160 feat(diagnostics): make LLM probe max_tokens configurable via env
The Settings → LLM diagnostic hardcoded max_tokens=200. Reasoning-capable
models (minimax-m2, o1, Gemini thinking) spend most of that budget on
internal thinking tokens and return empty visible content, which the
probe then reports as "LLM returned an empty response" even though the
API call succeeded.

Read the budget from LLM_TEST_MAX_TOKENS with a 1024 default (falls back
on non-numeric values). Documented in .env.example and plumbed through
docker-compose.yml.
2026-04-14 18:19:45 +03:00
Bingxi Zhao (Frank)
c754d57ae7 Merge branch 'dev' into main for v1.1.0-beta v1.1.0-beta 2026-04-14 22:12:19 +08:00
Bingxi Zhao (Frank)
9544075d60 v1.1.0-beta
URL-based chat routing, Snow theme, WebSocket heartbeat & auto-reconnect,
ChatComposer perf optimization, embedding provider registry overhaul,
Serper search provider, streaming idle timeout, and expanded test suite.

Made-with: Cursor
2026-04-14 22:11:48 +08:00
Bingxi Zhao
18a659e13b Merge pull request #320 from Jah-yee/fix-typo-chinese
Fix typo: Chinses -> Chinese
2026-04-14 22:02:45 +08:00
RoomWithOutRoof
64b2db2a99 Fix typo: Chinses -> Chinese 2026-04-14 20:56:23 +08:00
Bingxi Zhao
14b285d32f perf(web): fix severe input lag in long conversations (#317)
perf(web): fix severe input lag in long conversations (#317)
2026-04-14 20:29:53 +08:00
Bingxi Zhao
83e8b4a796 Merge pull request #309 from pietrondo/fix/windows-npm-cmd
fix: handle npm.cmd correctly on Windows
2026-04-14 20:20:08 +08:00
Bingxi Zhao
5342af3bfd Merge pull request #310 from markjanzer/fix/resolve-python-venv-symlink
fix: prefer unresolved sys.executable to stay inside venv
2026-04-14 20:18:26 +08:00
Bingxi Zhao
dd110e5583 Merge pull request #307 from OldSuns/fix/test-runner-extra-headers
fix: pass extra_headers to llm_complete in config test runner
2026-04-14 20:15:25 +08:00
Bingxi Zhao
98d4f8ebc0 Merge pull request #315 from srinivasrk/fix/oauth-cli-kit-version
fix: oauth-cli-kit>=0.2.0 does not exist, lower to >=0.1.1
2026-04-14 20:12:17 +08:00
jiakeboge
5f0553e3e9 perf(web): fix severe input lag in long conversations (#317)
- Memoize ChatMessageList, UserMessage, and ReferenceChips components.
- Stabilize onRetryMessage callback using useCallback in HomePage.
- Prevent unnecessary re-renders of the entire message history during text input.
2026-04-14 20:10:08 +08:00
Srini
25a3bb3f76 fix: lower oauth-cli-kit version constraint to match available releases
pyproject.toml required oauth-cli-kit>=0.2.0 but the latest available
version on PyPI is 0.1.3, causing dependency resolution to fail with UV
and pip when installing .[all] or .[oauth]. Lowered to >=0.1.1 to match
what requirements/cli.txt already specifies.
2026-04-13 21:57:37 -07:00
Mark Janzer
9010491bfd fix: prefer unresolved sys.executable to stay inside venv
On macOS with Homebrew Python, `Path(sys.executable).resolve()` follows
the venv symlink back to the system interpreter.  PEP 668 then blocks
pip installs with "externally-managed-environment", causing the setup
tour to fail.

Swap the check order so the unresolved venv path is preferred when it
exists, falling back to the resolved path only when necessary.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-13 11:36:05 -07:00
Pietro
d0c7406cb1 fix: use npm.cmd on Windows for proper npm command execution 2026-04-13 17:22:50 +02:00
Pietro
280d14bc0c fix: handle npm.cmd correctly on Windows
- Add _get_npm_command() helper to resolve npm path on Windows
- Use shell=True in _run_cmd() on Windows to support .cmd files
- Fix FileNotFoundError when running npm install on Windows

This fixes the issue where shutil.which('npm') fails to find npm.cmd
on Windows, causing the setup tour to fail during dependency installation.
2026-04-13 17:02:28 +02:00
OldSuns
0868747314 fix: pass extra_headers to llm_complete in config test runner
The _test_llm method in ConfigTestRunner was not forwarding extra_headers to
llm_complete(), causing custom User-Agent and other headers to be ignored
during model connection tests.

This ensures that user-configured extra_headers in model settings are properly
propagated to the LLM API call during connection testing.
2026-04-13 14:15:51 +00:00
Bingxi Zhao
0b180274e4 docs: update roadmap 2026-04-13 03:33:51 +08:00
Bingxi Zhao
337d7a4e97 docs: update readme
Add star history badge to README for DeepTutor.
2026-04-13 03:29:53 +08:00
Bingxi Zhao
b815e4c117 docs: update readme
Removed news section detailing past updates and milestones.
v1.0.3
2026-04-13 03:20:40 +08:00
Bingxi Zhao (Frank)
cf3bd89133 Merge branch 'main' of github.com:HKUDS/DeepTutor
Made-with: Cursor

# Conflicts:
#	README.md
2026-04-13 03:19:27 +08:00
Bingxi Zhao (Frank)
3ef46b9179 Merge branch 'dev' into main for v1.0.3 2026-04-13 03:18:41 +08:00
Bingxi Zhao (Frank)
8659d996f5 v1.0.3
Question Notebook with bookmarks & categories, Mermaid diagram support
in Visualize, embedding mismatch detection refinement, system message
merging for Qwen/vLLM, LM Studio & llama.cpp providers, Glass theme,
reporting agent retry resilience, and docs migration.

Made-with: Cursor
2026-04-13 03:18:26 +08:00
Bingxi Zhao
a3a209534e Merge pull request #292 from cskwork/feat/wrong-answer-note
feat: add wrong-answer note for cross-session quiz review
2026-04-12 21:54:19 +08:00
Bingxi Zhao
68f85f3708 Merge pull request #299 from SuperMarioYL/feat/embedding-model-mismatch-detection
feat: detect embedding model mismatch in knowledge bases
2026-04-12 21:36:46 +08:00
supermario_leo
8255f8bba2 feat: detect embedding model mismatch in knowledge bases
Record the embedding model and dimension used to index each knowledge base
in kb_config.json. On subsequent loads, compare the stored fingerprint
against the currently configured embedding model and flag mismatched KBs
with needs_reindex=True and embedding_mismatch=True.

When a mismatched KB is searched, a warning is included in the search
result so callers know search quality may be degraded and re-indexing
is recommended.

This prevents silent search quality degradation when users switch
embedding models (e.g., from text-embedding-3-large to nomic-embed-text)
without re-indexing their existing knowledge bases.
2026-04-12 18:26:12 +08:00