4771 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
d988be7757 Merge commit 'refs/pull/266/head' of github.com:HKUDS/DeepTutor into dev
Made-with: Cursor

# Conflicts:
#	deeptutor/agents/math_animator/renderer.py
2026-04-08 20:08:19 +08:00
Bingxi Zhao (Frank)
40c1a38995 fix: Windows-compatible Manim subprocess with streaming output
Replace asyncio.create_subprocess_exec with subprocess.Popen + reader
threads + asyncio.Queue. This fixes Windows SelectorEventLoop
incompatibility while preserving real-time line-by-line progress output
(unlike subprocess.run which buffers until completion).

Made-with: Cursor
2026-04-08 20:07:05 +08:00
Bingxi Zhao (Frank)
60b9b36357 docs: update readme 2026-04-08 20:02:13 +08:00
Bingxi Zhao (Frank)
5960fbc0f7 refactor: remove litellm dependency, align provider architecture
- Replace litellm with native openai + anthropic SDKs across both
  services and tutorbot layers
- Add 5 new providers: mistral, stepfun, xiaomi_mimo, qianfan, ovms
- Add `backend` field to ProviderSpec for SDK routing
- New TutorBot OpenAICompatProvider (openai SDK) and AnthropicProvider
  (anthropic SDK), replacing LiteLLMProvider
- Rewrite services/llm/executors.py to use openai SDK directly
- Remove litellm from factory.py routing, token_tracker, provider_cmd
- Auto-fallback to streaming for tool-call format errors (fixes #265)
- Settings UI: provider dropdown with auto base-url fill
- Clean up litellm from requirements/cli.txt and pyproject.toml

Made-with: Cursor
2026-04-08 19:59:44 +08:00
Bingxi Zhao (Frank)
546ca2f532 Merge remote-tracking branch 'origin/main' into dev 2026-04-08 17:30:58 +08:00
kevin
f6a081812e fix(guide): prevent polling from overwriting user's tab navigation
Backend poll (fetchPageStatuses) returns current_index=0 from
start_learning, which mergePageState unconditionally applied — causing
the UI to snap back to page 1 whenever the user clicked another tab.

Only accept server's current_index when user hasn't navigated yet
(current_index < 0), preserving tab selection during polling.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 16:12:03 +08:00
kevin
055c467a40 fix(guide): fix KaTeX math rendering in Guided Learning pages
- Configure $...$ and $$...$$ delimiters in auto-render (KaTeX default
  only recognizes $$..$$ and \(\..\))
- Remove broken SRI integrity hashes from CDN links (hash mismatch blocks
  resource loading)
- Add parent-window fallback rendering: detects bare LaTeX text nodes
  (e.g. \underbrace, \mathbb without $ wrapping), auto-wraps them,
  then calls renderMathInElement — handles cases where inline init script
  gets corrupted by page content containing </script> strings
- Increase guide agent max_tokens 8192->16384 to prevent HTML truncation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 16:12:03 +08:00
kevin
5c048a9609 Fix Windows compatibility for Math Animator renderer
This PR fixes multiple Windows compatibility issues that prevented
the Math Animator from generating videos on Windows systems.

### Changes

1. **renderer.py**: Fix subprocess execution on Windows
   - Replace `asyncio.create_subprocess_exec` with `subprocess.run` + `asyncio.to_thread`
   - The original approach silently fails on Windows when uvicorn uses SelectorEventLoop (default)
   - New approach works regardless of event loop type

2. **code_generator_agent.yaml (en/zh)**: Add Manim v0.20.1 compatibility constraints
   - Prohibit `MarkupText` (requires LaTeX)
   - Prohibit `stroke_dash_pattern` parameter (not supported in v0.20.1)
   - Prohibit `save_state()` method (not supported in MovingCameraScene)
   - Applied to both `generate_system` and `retry_system` sections

3. **ChatComposer.tsx**: Suppress hydration warning for i18n placeholder
   - Add `suppressHydrationWarning` to textarea
   - Resolves SSR/CSR text mismatch warning for language-specific placeholders

### Testing

- ✅ CLI mode: Successfully generated Pythagorean theorem animation (660KB)
- ✅ Web mode: Successfully generated cone cross-section animation
- ✅ Auto-retry: First attempt error → LLM repair → second attempt success

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 16:12:03 +08:00
chaohuang-ai
cf1a9ccdf1 Update README.md 2026-04-08 15:52:05 +08:00
Bingxi Zhao (Frank)
a4d9bd4860 fix: use sentinel for parse_json_response fallback so None is honored
The original implementation converted `fallback=None` to `{}`,
making `if data is None:` checks dead code in data_structures,
note_agent and reporting_agent. Use a `_UNSET` sentinel so callers
can explicitly request `None` as the failure value.

Also simplify control flow in data_structures and reporting_agent
to avoid raising ValueError inside bare try/except that wouldn't
catch it.

Made-with: Cursor
2026-04-08 12:11:19 +08:00
kagura-agent
b1623481c2 fix: use parse_json_response for LLM outputs to handle markdown fences
When response_format is unsupported (e.g. deepseek), LLMs return
JSON wrapped in markdown code fences (```json...```). Seven agent
modules used raw json.loads() which fails on fenced responses.

Replace with the existing parse_json_response() utility from
deeptutor/utils/json_parser.py which handles:
- Markdown code block extraction
- json-repair fallback for malformed JSON
- Graceful fallback on parse failure

Affected modules:
- agents/question/agents/idea_agent.py
- agents/solve/agents/planner_agent.py
- agents/guide/agents/design_agent.py
- agents/research/utils/citation_manager.py (3 call sites)
- agents/research/agents/reporting_agent.py
- agents/research/agents/note_agent.py
- agents/research/data_structures.py

Closes #179
2026-04-08 12:11:19 +08:00
Bingxi Zhao (Frank)
31adc67549 Revert "fix: use parse_json_response for LLM outputs to handle markdown fences (#263)"
This reverts commit e5c4b602d7.
2026-04-08 12:10:53 +08:00
Bingxi Zhao
a1991a094b Merge pull request #256 from kevinmw/fix/windows-manim-renderer
Fix Windows compatibility for Math Animator renderer
2026-04-08 12:08:34 +08:00
Bingxi Zhao (Frank)
b750f5b19f refactor: use ProactorEventLoop policy instead of subprocess.run fallback
Instead of replacing asyncio.create_subprocess_exec with subprocess.run
(which loses real-time streaming and cancellation), fix the root cause:
set WindowsProactorEventLoopPolicy before uvicorn starts so that
create_subprocess_exec works correctly on Windows.

This preserves the original async streaming renderer while fixing
Windows compatibility at the event loop level.

Made-with: Cursor
2026-04-08 12:07:33 +08:00
Kagura
e5c4b602d7 fix: use parse_json_response for LLM outputs to handle markdown fences (#263)
Replace raw `json.loads()` calls with `parse_json_response()` utility
across 7 agent modules (10 call sites) to handle LLM responses wrapped
in markdown code fences.

Additionally fix `parse_json_response` to use a sentinel default so
`fallback=None` is properly honored, and simplify control flow in
data_structures / reporting_agent to avoid dead-code branches and
uncatchable ValueError raises.

Closes #179
2026-04-08 12:05:41 +08:00
LocNguyenSGU
077762bde8 docs: clarify github copilot provider login semantics 2026-04-07 23:24:56 +07:00
Bingxi Zhao (Frank)
52e7c7e2a1 Merge branch 'dev' 2026-04-07 23:45:00 +08: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
kevin
7b55f11c7e Fix Windows compatibility for Math Animator renderer
This PR fixes multiple Windows compatibility issues that prevented
the Math Animator from generating videos on Windows systems.

### Changes

1. **renderer.py**: Fix subprocess execution on Windows
   - Replace `asyncio.create_subprocess_exec` with `subprocess.run` + `asyncio.to_thread`
   - The original approach silently fails on Windows when uvicorn uses SelectorEventLoop (default)
   - New approach works regardless of event loop type

2. **code_generator_agent.yaml (en/zh)**: Add Manim v0.20.1 compatibility constraints
   - Prohibit `MarkupText` (requires LaTeX)
   - Prohibit `stroke_dash_pattern` parameter (not supported in v0.20.1)
   - Prohibit `save_state()` method (not supported in MovingCameraScene)
   - Applied to both `generate_system` and `retry_system` sections

3. **ChatComposer.tsx**: Suppress hydration warning for i18n placeholder
   - Add `suppressHydrationWarning` to textarea
   - Resolves SSR/CSR text mismatch warning for language-specific placeholders

### Testing

- ✅ CLI mode: Successfully generated Pythagorean theorem animation (660KB)
- ✅ Web mode: Successfully generated cone cross-section animation
- ✅ Auto-retry: First attempt error → LLM repair → second attempt success

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 22:36:03 +08:00
yinlixin
0ec86bf8e7 fix(start-tour): tolerate non-utf8 subprocess output 2026-04-07 20:08:09 +08:00
Bingxi Zhao (Frank)
bb18739ee2 Merge branch 'dev' 2026-04-07 11:18:37 +08:00
Bingxi Zhao (Frank)
9f79945788 fix(ci): create minimal main.yaml for smoke tests
The smoke test job fails because router modules load main.yaml at
import time, but CI has no data/user/settings directory. Add a setup
step that writes a minimal config so pytest collection succeeds.

Made-with: Cursor
2026-04-07 11:18:30 +08:00
Bingxi Zhao (Frank)
3787bcb2d3 Merge branch 'dev' v1.0.0-beta.2 2026-04-07 11:15:05 +08:00
Bingxi Zhao (Frank)
6e41778872 docs: add v1.0.0-beta.2 release notes
Made-with: Cursor
2026-04-07 11:14:52 +08:00
Bingxi Zhao (Frank)
9382108ca0 Merge branch 'dev' 2026-04-07 11:12:33 +08:00
Bingxi Zhao (Frank)
881e332758 docs: update roadmap 2026-04-07 11:11:52 +08:00
Bingxi Zhao (Frank)
060516d9ff docs: update readme 2026-04-07 11:03:50 +08:00
Bingxi Zhao (Frank)
2d7024bab2 fix: python version 2026-04-07 11:03:50 +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
Bingxi Zhao
e8aa00e8f9 Merge pull request #250 from 2023Anita/fix/mimic-mineru-markdown
fix(question-generator): support nested MinerU output in mimic mode
2026-04-07 10:53:27 +08:00
Bingxi Zhao
8a7aabace4 Merge pull request #251 from 2023Anita/fix/python310-oauth-marker
fix(deps): gate oauth-cli-kit to Python 3.11+
2026-04-07 10:53:21 +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
da8cd9c746 fix(deps): gate oauth-cli-kit to python 3.11+ 2026-04-06 20:01:34 +08:00
yinlixin
1017aa25bf fix(deps): gate oauth-cli-kit to python 3.11+ 2026-04-06 19:32:01 +08:00
yinlixin
cef2e4001a fix(question-generator): support nested MinerU output 2026-04-06 12:59:29 +08:00
chaohuang-ai
65012a69e0 Update README.md 2026-04-05 01:20:14 +08:00
Bingxi Zhao (Frank)
81d5ae8043 Merge branch 'dev' 2026-04-04 13:35:24 +08:00
Bingxi Zhao (Frank)
410b432d61 update architecture diagrams
Made-with: Cursor
2026-04-04 13:30:34 +08:00
Bingxi Zhao (Frank)
e0cac1bafd Merge pull request #239 from HKUDS/dev
update tag
2026-04-04 13:24:05 +08:00
Bingxi Zhao (Frank)
1bb5e31d34 update tag 2026-04-04 13:23:14 +08:00
Bingxi Zhao (Frank)
540400c6e9 Merge pull request #238 from HKUDS/dev
Let's meet DeepTutor 1.0.0!
v1.0.0-beta.1
2026-04-04 13:10:53 +08:00
github-actions[bot]
85fc7deda7 chore: update repo roster images [skip ci] 2026-04-04 00:40:12 +00:00
github-actions[bot]
9ce6998175 chore: update repo roster images [skip ci] 2026-04-03 00:42:32 +00:00
Bingxi Zhao (Frank)
cf9d4c3a08 update readmes 2026-04-02 22:37:19 +08:00
Bingxi Zhao (Frank)
4a6ed166f7 update demos 2026-04-02 22:04:52 +08:00
Bingxi Zhao (Frank)
30b73c1db6 update figures 2026-04-02 21:57:20 +08:00
Bingxi Zhao (Frank)
467beaa5d3 update tutorbot 2026-04-02 21:18:14 +08:00