Commit Graph

490 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
a0ce450d80 refactor: separate previous_questions from history_context in quiz generation
Fixes semantic overloading introduced by PR #281 — history_context (conversation
history) is no longer mixed with the generated-questions dedup list.

- Add dedicated `previous_questions` parameter through Generator pipeline
- Extract `_strip_template_knowledge_context()` reused by both generate and repair paths
- Add `_format_previous_questions()` with MAX_PREVIOUS_QUESTIONS=20 cap
- Move language labels into YAML templates (en/zh) to avoid language mixing
- Simplify coordinator to pass raw list instead of string concatenation

Made-with: Cursor
2026-04-10 20:48:47 +08:00
Bingxi Zhao (Frank)
43ea51b08a Merge remote-tracking branch 'origin/main' into dev 2026-04-10 20:43:58 +08:00
Bingxi Zhao
36c24d73c6 Merge pull request #281 from Leadernelson/main
Prevent duplicate quiz questions by removing duplicates and adding history
2026-04-10 20:43:45 +08:00
Bingxi Zhao (Frank)
df844b8216 feat: add visualize capability with Chart.js/SVG rendering pipeline
- Add visualize agent pipeline (analysis → code generation → review)
- Add VisualizeCapability with request config and registry wiring
- Add frontend VisualizeConfigPanel, VisualizationViewer components
- Add chart.js and react-chartjs-2 dependencies
- Improve math_animator YON_IMAGE anchor block prompts (en/zh)
- Add minimax model override (supports_response_format: false)
- Suppress noisy uvicorn WebSocket connection logs
- Add selective HTTP access logging middleware (non-200 only)

Made-with: Cursor
2026-04-10 20:09:36 +08:00
Bingxi Zhao
9a3e718e66 Merge pull request #275 from kuishou68/fix/issue-274-o4-mini-max-completion-tokens
fix: extend o-series regex to cover o4-mini and future o-series models
2026-04-10 20:03:44 +08:00
Lucas Menten
0ca42b8862 Merge pull request #1 from Leadernelson/copilot/bugfix-same-quiz-questions
fix: prevent duplicate quiz questions caused by duplicated knowledge_context and missing generation history
2026-04-10 11:06:39 +02:00
copilot-swe-agent[bot]
b05abd269c fix: prevent duplicate quiz questions by removing duplicated knowledge_context and adding generation history
Agent-Logs-Url: https://github.com/Leadernelson/DeepTutor/sessions/98d69209-ee73-4cd7-832f-eac0650b097e

Co-authored-by: Leadernelson <184500545+Leadernelson@users.noreply.github.com>
2026-04-10 09:02:35 +00:00
Cocoon-Break
512fc9e665 fix: extend o-series regex to cover o4-mini and future o-series models (Closes #274) 2026-04-10 09:02:30 +08:00
Bingxi Zhao (Frank)
fc7b0fed59 docs: add v1.0.0-beta.4 release notes and README entry
Made-with: Cursor
v1.0.0-beta.4
2026-04-10 00:55:17 +08:00
Bingxi Zhao
780c248192 Merge pull request #272 from kuishou68/fix/issue-271-mime-type-case-insensitive
fix: use lowercased filename in mimetypes.guess_type() for consistent MIME validation
2026-04-10 00:48:41 +08:00
Bingxi Zhao (Frank)
0950c98e18 fix: merge PR #268 (embedding progress + 429 retry) with review fixes
Merge oxkage's embedding progress tracking and HTTP 429 rate limit
retry (PR #268), with the following review-driven improvements:

- Restore default batch_size=10 and request_timeout=60 to avoid
  performance regression for non-free-tier users
- Promote batch_delay to EmbeddingConfig (was private adapter attr)
  so all adapters respect user configuration instead of hardcoded 0.5s
- Use set_progress_callback() on existing embed model instead of
  creating a new CustomEmbedding instance (avoids global state mutation)
- Clean up progress callback in finally blocks to prevent leaking
  into subsequent search/query calls
- Wire progress_callback through add_documents (not just initialize)
- Remove dead HTTPStatusError 429 branch (already handled before
  raise_for_status)
- Remove unused total_docs variable in initializer

Made-with: Cursor
2026-04-10 00:33:57 +08:00
Cocoon-Break
cd33a527c1 fix: use lowercased filename in mimetypes.guess_type for consistent MIME validation 2026-04-10 00:30:06 +08:00
Bingxi Zhao (Frank)
3bc12fe28d fix: library management when start tour 2026-04-10 00:29:17 +08:00
Bingxi Zhao (Frank)
11efec2d48 Merge branch 'dev' — i18n scope clarification v1.0.0-beta.3 2026-04-08 20:22:26 +08:00
Bingxi Zhao (Frank)
b002975200 docs: clarify i18n coverage scope in README release note
Made-with: Cursor
2026-04-08 20:22:11 +08:00
Bingxi Zhao (Frank)
ecb329eb30 Merge branch 'dev' for v1.0.0-beta.3 release 2026-04-08 20:21:04 +08:00
Bingxi Zhao (Frank)
76f4d7e5e4 docs: add v1.0.0-beta.3 release notes and update README
Made-with: Cursor
2026-04-08 20:20:43 +08:00
Bingxi Zhao (Frank)
c86395a485 docs: update readme 2026-04-08 20:16:34 +08:00
Bingxi Zhao
4892a889a2 Merge pull request #262 from LocNguyenSGU/fix/issue-261-copilot-login-docs
docs: clarify github copilot provider login semantics
2026-04-08 20:13:50 +08:00
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