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
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
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
- 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
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>
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>
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
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
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
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
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>
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