50 Commits

Author SHA1 Message Date
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 (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
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
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)
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
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
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
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
2026-04-15 02:15: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 (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
cskwork
95b0609605 feat: add wrong-answer note for cross-session quiz review
Persist structured quiz mistakes on submission and expose them in a
new review page accessible from the utility sidebar.

Backend:
- New wrong_answers SQLite table (cascade on session delete) with
  add/list/count/update/delete store methods
- Hook POST /api/v1/sessions/{id}/quiz-results to also insert one row
  per incorrect answer, preserving the existing [Quiz Performance]
  text message consumed by the LLM context builder
- New GET /api/v1/wrong-answers (resolved filter + pagination),
  PATCH /{id} (resolved toggle), DELETE /{id}

Frontend:
- New /wrong-answers page under the (utility) route group with
  unresolved/all filter, mark-as-resolved, delete, and session link
- Sidebar nav entry using the NotebookPen icon
- English and Chinese i18n strings for all new UI text

Tests:
- 8 store tests covering filter, cascade, resolved toggle, delete
- 6 router tests including a regression test that record_quiz_results
  still writes the [Quiz Performance] text message
2026-04-12 00:40:06 +09:00
LocNguyenSGU
077762bde8 docs: clarify github copilot provider login semantics 2026-04-07 23:24:56 +07:00
Bingxi Zhao (Frank)
3ec4bc9bf0 fix(tests): align memory tests with two-file memory architecture
Memory service was refactored from single-file (content/exists/updated_at)
to two-file (summary/profile) architecture, but tests were not updated.

Made-with: Cursor
2026-04-07 23:44:35 +08:00
Bingxi Zhao
20686a6b31 Merge pull request #259 from 2023Anita/fix/start-tour-decode-errors
fix(start-tour): tolerate non-UTF-8 subprocess output
2026-04-07 23:42:42 +08:00
yinlixin
0ec86bf8e7 fix(start-tour): tolerate non-utf8 subprocess output 2026-04-07 20:08:09 +08:00
Bingxi Zhao
64d645fa59 Merge pull request #254 from YizukiAme/fix/settings-catalog-cache-invalidation
fix: invalidate runtime caches after settings changes
2026-04-07 10:53:39 +08:00
Bingxi Zhao
edcc06e030 Merge pull request #253 from YizukiAme/fix/mimic-ws-missing-imports
fix: add missing imports for mimic websocket router
2026-04-07 10:53:33 +08:00
Yizuki_Ame
faafc6745c fix: invalidate runtime caches after settings changes
Signed-off-by: Yizuki_Ame <yinzimike@gmail.com>
2026-04-07 02:19:31 +08:00
Yizuki_Ame
d84505ea22 fix: add missing imports for mimic websocket router
Signed-off-by: Yizuki_Ame <yinzimike@gmail.com>
2026-04-07 02:19:22 +08:00
yinlixin
cef2e4001a fix(question-generator): support nested MinerU output 2026-04-06 12:59:29 +08:00
zzhtx258
f04851e536 fix bugs, and enforce math video length 2026-03-22 19:49:14 +08:00
Bingxi Zhao (Frank)
c15e22a4b3 chore: stable fix, add tutorbot 2026-03-20 20:27:17 +08:00
Bingxi Zhao (Frank)
e11db5001b fix: improv cli 2026-03-15 00:04:34 +08:00
Bingxi Zhao (Frank)
9e8cea8294 fix: update embeddings config & provide perplexity search 2026-03-14 00:37:52 +08:00
Bingxi Zhao (Frank)
f3779138ae fix: remove lightrag and unify llm & search config 2026-03-13 23:48:49 +08:00
Bingxi Zhao (Frank)
9c18bf0705 codebase cleanup and decoupled, introduce cli operation 2026-03-13 20:42:16 +08:00
Bingxi Zhao (Frank)
91197f3729 chore: deeptutor 2.0 2026-03-13 01:47:38 +08:00
Bingxi Zhao (Frank)
ee419e832f chore: remove benchmark and iso_solve test from dev
Keep evaluation code only on the eval branch.

Made-with: Cursor
2026-03-09 19:59:29 +08:00
Bingxi Zhao (Frank)
f7d4adcc4f Merge remote-tracking branch 'origin/dev' into dev
Made-with: Cursor

# Conflicts:
#	AGENTS.md
#	config/main.yaml
#	src/agents/question/agents/evaluator.py
#	src/agents/question/agents/idea_agent.py
#	src/agents/question/cli.py
#	src/agents/question/coordinator.py
#	src/agents/question/prompts/en/evaluator.yaml
#	src/agents/question/prompts/en/generator.yaml
#	src/agents/question/prompts/en/idea_agent.yaml
#	src/agents/question/prompts/en/validator.yaml
#	src/agents/question/prompts/zh/evaluator.yaml
#	src/agents/question/prompts/zh/generator.yaml
#	src/agents/question/prompts/zh/idea_agent.yaml
#	src/agents/question/prompts/zh/validator.yaml
#	src/agents/solve/agents/planner_agent.py
#	src/agents/solve/agents/solver_agent.py
#	src/agents/solve/agents/writer_agent.py
#	src/agents/solve/cli.py
#	src/agents/solve/context.md
#	src/agents/solve/main_solver.py
#	src/agents/solve/memory/scratchpad.py
#	src/agents/solve/prompts/en/planner_agent.yaml
#	src/agents/solve/prompts/en/solver_agent.yaml
#	src/agents/solve/prompts/en/writer_agent.yaml
#	src/agents/solve/prompts/zh/planner_agent.yaml
#	src/agents/solve/prompts/zh/solver_agent.yaml
#	src/agents/solve/prompts/zh/writer_agent.yaml
#	src/api/routers/question.py
#	src/config/settings.py
#	src/core/event_bus.py
#	src/personalization/__init__.py
#	src/tools/code_executor.py
2026-03-09 16:50:19 +08:00
Bingxi Zhao (Frank)
05f758e569 Selective merge eval branch: solve/question/personalization 2.0
Merge the three core module rewrites from eval branch while preserving
all existing dev features (chat, co_writer, guide, ideagen, research,
API, frontend, Docker, etc.).

Solve: Plan->ReAct->Write architecture (3 agents) with ToolRegistry
  for selective tool injection via YAML definitions.
Question: Idea->Evaluate->Generate->Validate four-stage closed loop
  with coding question type and validator rejection mechanism.
Personalization: Three ReAct agents (Reflection/Summary/Weakness) with
  TraceForest/TraceTree, event-driven integration with solve/question
  via EventBus (SOLVE_COMPLETE/QUESTION_COMPLETE) and MemoryReader.

Also includes: benchmark pipeline, start.py CLI, shared module
improvements (LLM client, RAG parsers, EventBus flush, etc.).

Made-with: Cursor
2026-03-09 16:49:27 +08:00
infstellar
5654c0c9a1 feat: Add OpenRouter search provider 2026-02-10 17:19:26 +08:00
Scarlet Moore
6224e93092 Feature/llm hardening core slim (#52)
* Core LLM hardening (slim): essential fixes and tests only

* Add Anthropic and Local provider implementations
2026-01-29 14:08:39 +11:00
Pancake
0d860a2d12 fix: lint 2026-01-23 01:42:25 +08:00
Pancake
100ae27105 feat: add Chinese, frontend persistence, flexible import of rag library 2026-01-21 21:05:48 +08:00
Bingxi Zhao
1e9cc6b26d fix: KB init & migrate, code structure 2026-01-18 15:30:28 +08:00
Bingxi Zhao
c1752f0512 fix: rag-provider 2026-01-18 13:52:29 +08:00
Bingxi Zhao
74fbaf752d fix lint 2026-01-18 12:38:14 +08:00
Bingxi Zhao
b3f511d45f feat: enhance RAG pipeline with Docling support and improve CI/CD workflows 2026-01-18 12:25:45 +08:00
Bingxi Zhao
5a546b53f6 feat: enhance RAG pipeline with Docling support and improve CI/CD workflows 2026-01-18 12:25:45 +08:00
Pancake
f5b7a2e2df fix: env, file upload, web refactor, llm details 2026-01-15 21:05:16 +08:00
Scarlet Moore
cddc5160e8 work/llm-error-framework (#35)
* feat: enhance error handling and logging in DocumentAdder

* feat: implement robust error handling utilities for API exceptions

* style: fix formatting issues

* feat: implement retry logic for LLM API calls to handle rate limits and timeouts

* feat: enhance document validation and error handling in file uploads

* feat: enhance valid tools configuration and error handling in project structure

* feat: refactor error handling and validation functions for improved robustness

* fix: pre-commit format

* feat: implement configuration validation for tool consistency and enhance error handling in file uploads

* feat: add exception hierarchy for LLM service errors to improve error handling

* chore: update repo roster images [skip ci]

* chore: update repo roster images [skip ci]

* Integrate documentation updates and rebase onto upstream dev

* Implement error handling utilities and validation functions

* feat: implement multi-provider support with enhanced capability handling and model extraction

* fix: enhance error handling and validation across multiple modules

* chore: remove unused local environment configuration file

* commit

* fix: improve error handling and logging in utilities and error handler

* fix: enhance error handling and logging across multiple modules

* fix: enhance async initialization and validation in multiple modules

* feat: implement LLM error framework

- Add LLM-specific exception classes in exceptions.py
- Create error mapping utilities for standardized error handling
- Implement base provider interface with error handling
- Add OpenAI provider implementation with error mapping
- Define LLM types and response structures

* feat: add missing registry and telemetry modules

- Add registry.py for provider registration system
- Add telemetry.py for basic LLM call tracking
- Complete the LLM error framework implementation

* fix(llm): safer sync wrapper + smarter retries + optional openai mapping

* Fix LLM error framework and code quality improvements

* feat: update environment configuration and improve logging in LLM services

* Update README.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Refactor code structure for improved readability and maintainability

* chore: update documentation, improve error handling, and enhance file upload validation

* feat: enhance error handling and configuration validation across multiple modules

* feat: add configuration for pytest, improve error handling, and enhance byte formatting utilities

---------

Co-authored-by: scrrlt <smo0051@student.monash.edu>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-01-13 16:58:13 +11:00
scrrlt
d8d7045592 tests: add ConfigManager tests for atomic write, deep-merge, env layering 2026-01-09 16:08:18 +11:00
Pancake
89fab8ace1 Merge dev into main: service refactoring with preserved main features 2026-01-08 21:11:11 +08:00
RinCodeForge927
3b20344054 chore: fix ruff linting in tests and refine pre-commit config 2026-01-07 00:40:35 +07:00
Pancake
cf595bf562 refactor: restructure project architecture with new services and logging modules 2026-01-06 23:49:33 +08:00
Bingxi Zhao
b0e5a3fea2 feat: release ver0.3.0 2026-01-06 01:57:04 +08:00
Bingxi Zhao
d9abd3aa68 feat: release ver0.3.0 2026-01-06 01:56:17 +08:00
TejasD-13
9d321114f3 Fix end-of-file newline in test file 2026-01-01 15:28:04 +05:30
TejasD-13
987d11d6af Fix JSON parsing for triple-quoted Python strings 2026-01-01 12:31:44 +05:30