Commit Graph

2047 Commits

Author SHA1 Message Date
Bingxi Zhao
4733a1afc9 Merge pull request #449 from kagura-agent/fix/user-message-newline-444
fix(web): preserve newlines in user chat messages
2026-05-09 01:54:51 +08:00
Bingxi Zhao
657f68652c Merge pull request #445 from Starfie1d1272/feat/cli-start-command
feat: add deeptutor start command to launch backend and frontend together
2026-05-09 01:54:38 +08:00
Bingxi Zhao
7b73769fe9 Merge pull request #453 from Starfie1d1272/fix/deepseek-reasoning-effort-minimal
fix(llm): stop sending reasoning_effort=minimal as top-level param to providers that reject it
2026-05-09 01:54:23 +08:00
Bingxi Zhao
f1572e8f29 Merge pull request #447 from Starfie1d1272/fix/add-deepseek-v4-pricing
fix: add deepseek-v4-flash and deepseek-v4-pro to model pricing table
2026-05-09 01:54:10 +08:00
Bingxi Zhao
d6b8eedcca Merge pull request #442 from wedone/fix/context-window-vision-upstream
fix: raise context_window ceiling and add qwen vision support
2026-05-09 01:53:52 +08:00
Phillip Lagoc
bba92a865e chore: files edited after running pre-commit for all files 2026-05-07 16:19:21 -07:00
Phillip Lagoc
73c1798e75 docs: replaced placeholder tooltip text 2026-05-07 16:07:09 -07:00
Phillip Lagoc
45267e275d removed tooltips from expanded state 2026-05-07 15:50:55 -07:00
Phillip Lagoc
3d44bb62c1 show expanded sidebar tooltips on the right instead of bottom 2026-05-07 15:09:16 -07:00
Phillip Lagoc
5732b1501f scope CSS selectors, add pointer-events-none, instant focus, unmount cleanup, made prettier 2026-05-07 14:34:28 -07:00
Phillip Lagoc
19679b7bae added truncation and max sizing to tooltips 2026-05-07 14:24:36 -07:00
Phillip Lagoc
646a241b02 wrapped PRIMARY_NAV items with Tooltip for expanded and collapsed states, refactored Tooltip prop 2026-05-07 14:05:24 -07:00
Bortlesboat
b4cca8e108 fix: add tutorbot nvidia nim provider 2026-05-07 16:23:22 -04:00
Bingxi Zhao (Frank)
2c4769a96f prepare v1.3.8 release
Co-authored-by: Cursor <cursoragent@cursor.com>
v1.3.8
2026-05-08 02:36:24 +08:00
whf
8e5c601012 Fix #3: add init-modules endpoint + router registration in main.py (with Codex edge case fix) 2026-05-07 22:05:21 +08:00
whf
44a77b4afd Fix #3+#5: add init-modules endpoint + DEBUG_MODE (LEARNING_DEBUG=1 for second-level intervals) 2026-05-07 21:54:04 +08:00
Phillip Lagoc
2f3af52890 feat(sidebar): add i18n-aware tooltips, init new Tooltip component, and refactoring PRIMARY_NAV_BAR in SidebarShell 2026-05-06 14:55:36 -07:00
unknown
4f30e0fa1a fix(guided-learning): convert error_type string to ErrorType enum in submit_answer 2026-05-06 22:48:46 +08:00
Xinyu Du
1ef3995f62 fix(llm): stop sending reasoning_effort=minimal as top-level param to providers that reject it
DeepSeek only accepts high / max / low / medium / xhigh for reasoning_effort,
but the code unconditionally forwarded the configured value as a top-level
parameter.  When LLM_REASONING_EFFORT=minimal (DeepTutor convention for
"disable thinking"), DeepSeek rejects the request with:

  unknown variant minimal, expected one of high, low, medium, max, xhigh

Fix across three provider layers:
- provider_core:  skip top-level reasoning_effort when the provider spec
  has thinking_style and the semantic effort is "minimal" — the thinking
  control is already expressed via extra_body
- tutorbot:  same logic + add deepseek & minimax to the extra_body chain
  (they were missing, so thinking disable was silently ignored)
- cloud_provider:  skip reasoning_effort=minimal for providers that handle
  thinking through extra_body

Other providers (OpenAI, Anthropic, Gemini, Mistral, etc.) are unaffected
because they either don't have thinking_style or accept minimal natively.
2026-05-06 21:28:27 +08:00
WeDone
dccc7fc08b feat(tutorbot): add Zulip channel support
Add Zulip as a new messaging channel for DeepTutor tutorbot.

Features:
- Private message and stream message support
- Event queue API (register/get_events/deregister) for reliable message listening
- Three-layer infinite loop protection (max_message_id, own message filter, dedup)
- File upload/download with configurable timeout and retry
- Permission control via allow_from (supports both user_id and email)
- Stream group policy: mention (respond only when mentioned) / open (respond to all)
- KaTeX/LaTeX bidirectional conversion for math formulas
- Typing indicator support for private chats (Zulip native API)

Technical highlights:
- Uses call_endpoint with custom timeout instead of send_message/upload_file
  (default 15s timeout causes ReadTimeout on file uploads)
- Sync-async bridging via run_in_executor and run_coroutine_threadsafe
- Automatic event queue re-registration on BAD_EVENT_QUEUE_ID error

Tests: 88 unit tests covering all core functionality
2026-05-06 20:34:27 +08:00
kagura-agent
3ebf26225e fix(web): preserve newlines in user chat messages (#444)
Add whitespace-pre-wrap to the user message content div so that
newlines entered via Shift+Enter are rendered correctly instead of
being collapsed into a single line.
2026-05-06 15:35:54 +08:00
whf
e9b03cb523 i18n: Add Guided Learning translations (zh/en) and wiring in ChatMessages + playground 2026-05-06 10:45:55 +08:00
whf
5ebdf19893 Frontend: Add Guided Learning to capability picker in chat page 2026-05-06 09:56:43 +08:00
whf
23bf4537e7 Block 12: Add guided learning API router (GET progress, POST answer, GET reviews) 2026-05-06 09:49:32 +08:00
whf
66c0a7f9ca Block 7-11: Add GuidedLearningCapability — full Framework v1.8.2 state machine with mock LLM 2026-05-06 09:42:13 +08:00
whf
225c645137 Block 6+13: Add 6 new BlockType values + register GuidedLearningCapability 2026-05-06 02:31:43 +08:00
whf
de8fbdfed8 Block 5: Add LearningService — business logic layer for progress, modules, quiz recording, mastery tracking 2026-05-06 02:29:14 +08:00
whf
0c33efb878 Block 4: Add pytest unit tests for models (21), storage (13), scheduler (18) — 52/52 pass 2026-05-06 02:19:33 +08:00
Xinyu Du
1ee7b8204c fix: add deepseek-v4-flash and deepseek-v4-pro to model pricing table
Pricing per DeepSeek API docs (per 1K tokens):
- deepseek-v4-flash: $0.00014 input, $0.00028 output
- deepseek-v4-pro: $0.000435 input, $0.00087 output
2026-05-06 02:18:34 +08:00
whf
b252bf7e5a Block 3: Add spaced repetition scheduler (Framework v1.8.2 §9.1 interval sequence algorithm) 2026-05-06 02:10:13 +08:00
whf
50a6e14793 Block 2: Add JSON storage layer for LearningProgress with path traversal protection 2026-05-06 01:54:13 +08:00
Xinyu Du
2b9bf9a4f1 feat: add deeptutor start command to launch backend and frontend together
Add a `start` CLI command that delegates to scripts/start_web.py so users
can launch the full web app with a single command instead of manually
running `python scripts/start_web.py`.
2026-05-06 01:51:45 +08:00
whf
a177d2b22b Block 1: Add learning data models (4 enums + 9 Pydantic models per Framework v1.8.2) 2026-05-06 01:40:28 +08:00
WeDone
6c2751c86c fix(tests): update context_window assertion after MAX_EFFECTIVE_CONTEXT_WINDOW ceiling raise
The test hardcoded 65536 as the expected effective context window,
but after raising MAX_EFFECTIVE_CONTEXT_WINDOW to 1_000_000 the
explicit context_window=128000 is no longer truncated. Update the
assertion to match the new correct behavior.
2026-05-05 11:42:33 +08:00
WeDone
0efc068ac1 fix: raise context_window ceiling and add qwen vision support
- context_window.py: raise MAX_EFFECTIVE_CONTEXT_WINDOW from 65536 to
  1000000 (safety cap, not a ceiling for reasonable configs).
  Add LARGE_CONTEXT_MODEL_DEFAULT=65536 to break the circular
  reference where default_context_window_for_model() returned
  MAX_EFFECTIVE_CONTEXT_WINDOW, making default=ceiling=65536.
  User-configured values (via WebUI or model_catalog.json) are
  now respected instead of being truncated by min(x, 65536).
  All default values remain unchanged (65536).

- capabilities.py: add supports_vision=True to MODEL_OVERRIDES['qwen']
  so that qwen models are recognized as vision-capable regardless
  of binding (custom, dashscope, etc.), not just when binding=openai.
2026-05-04 22:49:26 +08:00
Bingxi Zhao (Frank)
5c31f0dee6 Merge remote-tracking branch 'origin/main' into multi-user
# Conflicts:
#	deeptutor/knowledge/manager.py
#	deeptutor/services/memory/service.py
#	pyproject.toml
#	requirements/server.txt
#	web/app/(workspace)/agents/page.tsx
2026-05-04 17:12:06 +08:00
WeDone
6ca722cbde fix(agents): normalize single newlines to markdown paragraphs in quiz content
LLMs often emit single \\n characters between logical paragraphs in
question / answer / explanation fields. In markdown this renders as a
soft-break, causing the front-end to collapse everything into one dense
block.

Add _normalize_markdown_paragraphs() to Generator so that isolated
single newlines are turned into \\n\\n paragraph breaks before the
payload is returned. Structural markers (lists, code fences, tables,
headings) are preserved to avoid breaking intentional formatting.

Fixes quiz questions appearing without paragraph spacing in the web UI.
2026-05-04 16:52:27 +08:00
Bingxi Zhao (Frank)
93891789fa prepare v1.3.7 release
Co-authored-by: Cursor <cursoragent@cursor.com>
v1.3.7
2026-05-04 16:21:41 +08:00
Bingxi Zhao
b1faa72bbd Merge pull request #428 from Starfie1d1272/fix/deepseek-reasoning-content-fallback
fix: fallback content to reasoning_content when DeepSeek returns empty content field
2026-05-04 12:08:22 +08:00
Bingxi Zhao (Frank)
d23ea03640 Merge remote-tracking branch 'origin/dev' into fix/deepseek-reasoning-content-fallback
# Conflicts:
#	deeptutor/book/blocks/code.py
#	deeptutor/book/blocks/deep_dive.py
#	deeptutor/book/blocks/flash_cards.py
#	deeptutor/book/blocks/timeline.py
2026-05-04 12:07:37 +08:00
Bingxi Zhao
5520e2141e Merge pull request #436 from zuoliangyu/fix/chat-extra-headers
fix(chat): forward extra_headers to all LLM calls in agentic pipeline
2026-05-04 11:53:21 +08:00
Bingxi Zhao (Frank)
eff1c0dff6 prepare v1.3.6 release
Co-authored-by: Cursor <cursoragent@cursor.com>
v1.3.6
2026-05-03 16:35:52 +08:00
Bingxi Zhao
f5fdf77e33 Merge pull request #439 from sagnikonly/fix/skill-ui-validation-and-modal
fix(ui): skill editor validation and modal background
2026-05-03 16:23:45 +08:00
sagnikonly
504da9e05a fix(ui): skill editor validation and modal background 2026-05-03 11:07:03 +05:30
Bingxi Zhao
abe8020299 Merge pull request #438 from truffle-dev/fix/responses-api-max-completion-tokens-mapping
fix(llm): map max_completion_tokens to max_output_tokens for Responses API
2026-05-03 12:50:55 +08:00
truffle
eb3cd9a3fa fix(llm): map max_completion_tokens to max_output_tokens for Responses API
When the Responses API path is selected for newer OpenAI models
(gpt-5.x, o1, o3, o4) and an extra kwarg of `max_completion_tokens`
flows in (typically from `get_token_limit_kwargs(model, n)`), the
OpenAI SDK raises `TypeError` from `responses.create()` before any
HTTP request leaves the client.

`_should_fallback_from_responses_error()` only catches HTTP errors
that carry a `status_code`, so the call is never retried via Chat
Completions; the user just sees a stack trace. The bug exists on
both OpenAICompatProvider and AzureOpenAIProvider, in the chat and
chat_stream paths (4 sites total).

Add `adapt_chat_kwargs_to_responses()` that translates the alias to
`max_output_tokens` and is used at all four merge sites. The helper:
- preserves the existing `None`-drop semantics of the previous
  dict-comprehension merge,
- only applies the alias when `max_output_tokens` is not explicitly
  set by the caller,
- does not mutate the input.

Closes #437.
2026-05-03 02:18:34 +00:00
zuolan
51f82993f5 fix(chat): forward extra_headers to all LLM calls in agentic pipeline
The chat capability silently dropped `extra_headers` from the active
LLM profile because three downstream call sites in `AgenticChatPipeline`
did not forward them:

- `_build_openai_client()` constructed `AsyncOpenAI` /
  `AsyncAzureOpenAI` without `default_headers`, so custom headers
  required by some gateways (e.g. a `User-Agent` override to bypass
  WAF allowlists that block `OpenAI/Python <ver>`) were lost on the
  native-tool-calling path.
- `_stream_messages` and `_run_react_fallback` invoked `llm_stream()`
  with `model`, `api_key`, `base_url`, `binding` but no
  `extra_headers`. The factory's `_resolve_call_config` treats this
  set of caller-provided fields as an explicit override and rebuilds
  `LLMConfig` with empty `extra_headers`, bypassing the catalog value
  loaded by `get_llm_config()`.

Pulls `extra_headers` from `llm_config` once in `__init__` and
forwards it from all three call sites.

Reproduce: configure an OpenAI-compatible gateway whose WAF rejects
the default `OpenAI/Python <ver>` User-Agent; set
`extra_headers: { "User-Agent": "Mozilla/5.0 ..." }` on the active
LLM profile in `model_catalog.json`. Before this change, chat returns
HTTP 403 "Your request was blocked." After, the override reaches the
gateway and chat succeeds.
2026-05-03 00:01:46 +08:00
Bingxi Zhao (Frank)
49661211ce prepare v1.3.5 release
Co-authored-by: Cursor <cursoragent@cursor.com>
v1.3.5
2026-05-02 20:16:07 +08:00
Bingxi Zhao
4fcf93f112 Merge pull request #435 from truffle-dev/fix/settings-select-dark-mode-popover
fix: paint settings select dark-mode dropdown popover background
2026-05-02 18:43:45 +08:00
truffle
8d37a7ce4c fix: paint settings select dark-mode dropdown popover background
The Provider <select> in Settings used `bg-transparent`, leaving the
native dropdown popover unpainted. On Edge/Chromium with the
`.dark` theme the popover renders against a white surface despite
`color-scheme: dark` being set, leaving option text near-invisible
(reported in #433 with screenshots).

Switch the shared `selectClass` to `bg-[var(--background)]` so the
closed select keeps its current visual (--background matches the
form panel in every theme) and the opened popover inherits the
themed surface — `#1a1918` in dark, `#faf9f6` in light, equivalent
in theme-snow / theme-glass.

Closes #433.
2026-05-02 07:06:09 +00:00