619 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
28e225ee0e chore: prepare v1.3.1 release
Stability release after v1.3.0 covering safer RAG/KB routing, stronger
embedding validation, more reliable Docker/TutorBot restarts, Web UX
fixes, and Windows/encoding hardening. See assets/releases/ver1-3-1.md
for the full notes.

Made-with: Cursor
v1.3.1
2026-04-28 12:00:11 +08:00
Bingxi Zhao (Frank)
7fce54d98a chore: prepare v1.3.0 release
Made-with: Cursor
v1.3.0
2026-04-27 21:09:25 +08:00
Bingxi Zhao
8594b46cf8 Merge pull request #391 from jonathanzhan1975/fix/server-deps-and-utf8-encoding
fix: server startup on Windows + missing runtime deps in server.txt
2026-04-27 10:32:56 +08:00
Bingxi Zhao (Frank)
162a3f9dc4 fix: missing pip 2026-04-26 21:52:53 +08:00
jonathanzhan1975
8e1ceba3aa fix: server startup on Windows + missing runtime deps
Two independent issues that block `python scripts/start_web.py` after a
clean install on Windows:

1. UnicodeDecodeError when streaming subprocess output

   `_spawn()` opened the backend / frontend stdout pipe with `text=True`
   but no explicit encoding. On Windows this defaults to the system
   ANSI codepage (e.g. `gbk` on Chinese Windows), which raises
   `UnicodeDecodeError` as soon as the child process emits a UTF-8 byte.

   Fix: pin `encoding="utf-8"` and `errors="replace"` so any locale
   produces clean, lossless output.

2. Missing runtime dependencies in requirements/server.txt

   `deeptutor/services/llm/provider_core/__init__.py` unconditionally
   imports `AnthropicProvider`, `OpenAICompatProvider`, and
   `OpenAIResponses`, which in turn import:

     - `loguru`        (provider_core/base.py, openai_codex_provider.py,
                        openai_responses/parsing.py)
     - `json_repair`   (anthropic_provider.py, openai_compat_provider.py,
                        openai_responses/parsing.py)

   These are declared only in `requirements/tutorbot.txt`, so
   `pip install -r requirements/server.txt && pip install -e .` followed
   by `python scripts/start_web.py` crashes with `ModuleNotFoundError`
   before the API server can serve a single request.

   Fix: declare both packages in `server.txt` with the same version
   bounds used by `tutorbot.txt`.

Reproduced and verified on Windows 11 + Python 3.12 + a fresh venv.
2026-04-26 09:16:06 +08:00
Bingxi Zhao (Frank)
6428458049 chore: prepare v1.2.5 release v1.2.5 2026-04-25 22:08:44 +08:00
Bingxi Zhao (Frank)
fba51dc856 fix: auto-update, auto-scroll to the bottom 2026-04-25 17:47:56 +08:00
Bingxi Zhao (Frank)
c89a3df8a5 chore: prepare v1.2.4 release v1.2.4 2026-04-25 15:10:55 +08:00
Bingxi Zhao
d7649b7a62 Merge pull request #379 from kKamUL/docs/polish-readme-translation
docs: add Polish translation of README
2026-04-25 14:20:10 +08:00
Bingxi Zhao
f2686c4820 Merge pull request #376 from rogercsi/fix/uv-pip-compat
fix(scripts): prefer uv pip over python -m pip in start_tour.py
2026-04-25 14:19:52 +08:00
Bingxi Zhao
a524abac23 Merge pull request #381 from jonathanzhan1975/fix/npm-cmd-detection-windows
fix: use npm.cmd for version detection on Windows
2026-04-25 14:12:37 +08:00
jonathanzhan1975
5586b7861e fix: use npm.cmd for version detection on Windows
On Windows, npm is installed as npm.cmd rather than a plain executable.
subprocess.run(['npm', '--version']) without shell=True raises
FileNotFoundError, causing the Node.js detection step to always report
npm as missing even when it is properly installed.

Reuse the existing _get_npm_command() helper (which already returns
npm.cmd on Windows) for the version-detection call, consistent with
how npm is invoked later during npm install.
2026-04-25 08:59:12 +08:00
kKamUL
5b133ef079 docs: add Polish translation of README 2026-04-24 19:59:35 +02:00
Bingxi Zhao (Frank)
e8a569a618 docs: update readme 2026-04-24 23:25:29 +08:00
Bingxi Zhao (Frank)
b5eab8b67a fix: tour 2026-04-24 23:15:26 +08:00
zouchengfu
55e744ac63 fix(scripts): prefer uv pip over python -m pip in start_tour.py
uv-managed .venv environments may have pip disabled (PEP 668 / uv's
default hardening).  Running `python -m pip install` inside such a venv
raises a CalledProcessError even though uv itself is available.

Introduce `_resolve_pip_cmd()` which checks `shutil.which("uv")` at startup:

- uv found  → use ["uv", "pip"] (uv auto-detects the active venv)
- uv absent → fall back to [_PYTHON, "-m", "pip"] (no regression)

All pip invocations in `_bootstrap()` and `_install_commands()` now use
`_PIP_CMD` instead of the hard-coded `[_PYTHON, "-m", "pip"]` prefix.
2026-04-24 22:53:16 +08:00
Bingxi Zhao (Frank)
9dbb3a8f3f Merge branch 'dev' into main: v1.2.3 v1.2.3 2026-04-24 22:37:03 +08:00
Bingxi Zhao (Frank)
4b7d24d33e release: v1.2.3 — document attachments, thinking blocks, provider core refactor
- Chat document attachments (PDF/DOCX/XLSX/PPTX) with text extraction
- Reasoning model <think> block display as collapsible cards
- Tri-state send_dimensions toggle for embeddings (#368)
- LLM provider_core module refactor + context_window detection
- Soul template editor (PR #373), Co-Writer save-to-notebook
- Knowledge Base drag-and-drop upload, delete resilience (#370),
  progress persistence, supported-file-types endpoint
- Question generation language fidelity via shared prompt directives
- Settings tour redesign, CLI notebook add-md/replace-md
- Bug fixes: CJK bot name slug, I18nProvider init, Skills default off,
  Moonshot base URL, version badge
- Provider registry: custom_anthropic, thinking_style, alias expansion
- +1900 test lines across 15 new/expanded test files

Made-with: Cursor
2026-04-24 22:36:32 +08:00
Albert Zheng
ecb1a9349a feat(cli): add add-md and replace-md commands to notebook group
deeptutor notebook add-md <notebook_id> <file> [--title T] [--type TYPE]
  Read a markdown file and add it as a record to a notebook.

deeptutor notebook replace-md <notebook_id> <record_id> <file>
  Replace an existing record's output with content from a markdown file.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-24 20:23:53 +08:00
Bingxi Zhao
3282801eaa Merge pull request #373 from srinivasrk/srinikul/soul-template-editor
feat: Revamp soul template creation and usage
2026-04-24 20:04:40 +08:00
Srini
3c27df85c2 feat: Revamp soul template creation and usage
You can now edit soul templates and save them directly from the profiles
page. This removes the need to create the template first and then using
in the profiles tab
2026-04-23 11:13:28 -07:00
Bingxi Zhao (Frank)
8b887589f2 Merge branch 'dev' into main: tri-state send_dimensions 2026-04-23 20:20:50 +08:00
Bingxi Zhao (Frank)
2c39eb4fc9 feat(embedding): tri-state send_dimensions toggle (UI + env + catalog)
Generalises #368: adds an explicit per-model `send_dimensions` opt-in
exposed as a Settings UI toggle and an EMBEDDING_SEND_DIMENSIONS env var.

Tri-state semantics:
  true   -> always send (user knows their provider supports it)
  false  -> never send  (e.g. Qwen text-embedding-v4 via litellm gateway
                         which returns HTTP 400 when `dimensions` is sent)
  unset  -> fall back to the text-embedding-3* heuristic from #368

Backend:
- Adapter base accepts `send_dimensions`; OpenAI-compatible adapter
  decides via `_should_send_dimensions(model)` (replaces the hardcoded
  startswith check from #368).
- ResolvedEmbeddingConfig / EmbeddingConfig carry the flag through.
- EnvStore reads/writes EMBEDDING_SEND_DIMENSIONS, dropping the line
  entirely when empty so legacy `.env` files keep the Auto behaviour.
- ModelCatalogService syncs the flag from .env back into the catalog.

Frontend:
- Settings page shows a "Send dimensions" checkbox next to Dimension,
  with an instant CSS-only info tooltip (replaces native `title` to
  avoid the browser's ~1s delay). Disabling the toggle greys out the
  Dimension input.
- New models default to send_dimensions=true.
- en/zh i18n strings added.

Tests (46 new cases, including the unit tests #368 marked added but
did not actually ship):
- adapter `_should_send_dimensions` tri-state + parametrized non-3 family
- httpx-mocked payload assertions for all four combinations
- runtime resolver: catalog wins over env, garbage values -> None
- env_store helpers + render_from_catalog + write skip-empty round-trip
- EmbeddingClient propagates the flag to the adapter config dict

Made-with: Cursor
2026-04-23 20:16:08 +08:00
jefflv
bf4f1429a2 fix(embedding): gate dimensions for text-embedding-3 models (#368)
Co-authored-by: jefflrq <jeff.lrq@yungu.org>
2026-04-23 19:38:11 +08:00
Bingxi Zhao (Frank)
77f29cbcc7 fix lint 2026-04-23 19:29:16 +08:00
Bingxi Zhao (Frank)
6a99ba721c update docs 2026-04-23 17:34:12 +08:00
Bingxi Zhao (Frank)
5cb7daa3ea Merge branch 'dev' into main: fix version badge 2026-04-22 20:56:43 +08:00
Bingxi Zhao (Frank)
4d60ec8cbb fix: version# 2026-04-22 20:55:48 +08:00
Bingxi Zhao (Frank)
05374007de Merge branch 'dev' into main (v1.2.2) v1.2.2 2026-04-22 20:46:08 +08:00
Bingxi Zhao (Frank)
2f6ac5aa80 release: v1.2.2 — Skills system, input perf, response_format auto-fallback, version badge
- User-authored Skills system (CRUD backend + REST API + chat composer integration)
- Chat input performance overhaul: ComposerInput / SimpleComposerInput state colocation
- response_format auto-fallback & runtime cache for incompatible providers
- LAN remote access fix (resolveBase hostname swap)
- Sidebar version badge with GitHub release comparison + GitHub icon link
- Deep Solve image attachment support via unified Attachment pipeline
- Agentic chat pipeline attachment passthrough in responding + acting stages
- TutorBot WebSocket auto-start, _safe_send, graceful disconnect
- Settings page API key masking with Eye/EyeOff toggle
- Book Library UI with search, status cards, and simplified BookSidebar
- Visualization fullscreen mode for SVG/Mermaid/ChartJS
- Embedding ConnectError retry, RAG None-embedding hardening
- KB delete robustness for orphaned config entries
- CLI parse_json_object whitespace normalization
- answer_now response_format guard
- New tests: TutorBot WS, CLI helpers, route-params, api-resolve-base
- Release notes (ver1-2-2.md) and README update

Made-with: Cursor
2026-04-22 20:45:51 +08:00
Bingxi Zhao (Frank)
417e38a02f Merge PR #362: perf/optimize chat input (perf/optimize-chat-input -> dev)
perf(web): decouple chat input state to resolve lag in long conversations (#351)
- Extract ComposerInput / SimpleComposerInput to isolate keystroke renders
- Apply React.memo to heavy config panels
- Stabilize parent callbacks with useCallback
2026-04-22 19:13:34 +08:00
Bingxi Zhao (Frank)
5662c1cfde merge: resolve conflicts with dev for PR #362
Keep PR's state-colocation approach (handleSend receives content from
child component) while incorporating dev's botId guard.
Export @mention helpers for cross-component reuse.

Made-with: Cursor
2026-04-22 19:13:08 +08:00
jiakeboge
3bd857cf7e perf(web): resolve residual input lag in tutorbot interface (#351)
Extract lightweight `SimpleComposerInput` to isolate keystroke renders.
 Colocate input state in `agents/[botId]/chat/page.tsx` to prevent full-page lag.
Export @mention utility helpers from `ComposerInput.tsx` for cross-component use.
Address follow-up feedback from StarNight2021 regarding tutorbot-only performance.
This completes the performance overhaul by ensuring all chat entry points use optimized state colocation patterns.
2026-04-22 18:03:37 +08:00
jiakeboge
e18dfb311f perf(web): decouple chat input state to resolve lag in long conversations (#351) (#360)
Extract `ComposerInput` component to isolate frequent keystroke renders.
Refactor `ChatComposer` to use `hasContent` flag instead of full `input` state.
 Apply `React.memo` to heavy config panels (Quiz, Math, Research, Visualize).
Stabilize parent callbacks in `ChatPage` using `useCallback`.
Fix residual syntax errors and missing `canSend` definition in composer.
Address HKUDS/DeepTutor#351 by implementing deep state colocation.
2026-04-22 17:06:08 +08:00
Zakir Jiwani
21aef5830a Fix LAN access: replace localhost with browser hostname at runtime (#340)
NEXT_PUBLIC_API_BASE is baked in at build time (typically
http://localhost:<port>). When a remote machine on the LAN opens
the app its browser resolves "localhost" to its own loopback
address instead of the server, so all API calls fail and the
Settings page shows LLM 0 / EMBEDDING 0 / SEARCH 0.

Introduce resolveBase() which detects this case at runtime: if the
configured base URL points to localhost/127.0.0.1 but the browser's
window.location.hostname is a remote address, the hostname is
replaced with window.location.hostname so requests reach the actual
server. wsUrl() is updated in the same way.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 17:06:00 +08:00
Srinivas R Kulkarni
6735adf32c fix : Tutorbot websocket resilience and CLI config parsing edge case (#354)
Handle blank --config-json safely, auto-start bots on websocket connect, guard botId route param usage in UI,
and add regression tests for CLI/router/web param normalization.`
2026-04-22 17:05:51 +08:00
Srinivas R Kulkarni
7d5c372347 feat: Hide the API key on settings page (#355) 2026-04-22 17:05:41 +08:00
S-A-D-4
568085c8ad fix: add ConnectError to embedding retry exceptions (#353)
The embedding adapter's retry mechanism was missing httpx.ConnectError,
causing immediate failure instead of retry when network connectivity
issues occur (e.g., TLS handshake failures, proxy connection issues).

This fix ensures that transient connection errors are retried with
exponential backoff, improving reliability during knowledge base
initialization.
2026-04-22 17:05:30 +08:00
jiakeboge
a3a645a7da perf(web): decouple chat input state to resolve lag in long conversations (#351)
Extract `ComposerInput` component to isolate frequent keystroke renders.
Refactor `ChatComposer` to use `hasContent` flag instead of full `input` state.
 Apply `React.memo` to heavy config panels (Quiz, Math, Research, Visualize).
Stabilize parent callbacks in `ChatPage` using `useCallback`.
Fix residual syntax errors and missing `canSend` definition in composer.
Address HKUDS/DeepTutor#351 by implementing deep state colocation.
2026-04-22 11:40:10 +08:00
Bingxi Zhao (Frank)
8cc4a29b23 Merge branch 'dev' into main 2026-04-21 01:36:16 +08:00
Bingxi Zhao (Frank)
203758c5d3 docs: update readme 2026-04-21 01:35:42 +08:00
Bingxi Zhao (Frank)
cb7deebc78 fix: readme, kb-management, book management 2026-04-21 01:20:53 +08:00
Bingxi Zhao (Frank)
01ad5f1bb1 Merge branch 'dev' into main v1.2.1 2026-04-21 00:32:42 +08:00
Bingxi Zhao (Frank)
745a1d3d74 docs: fix v1.2.1 release date (2026.04.20 -> 2026.04.21)
Made-with: Cursor
2026-04-21 00:32:28 +08:00
Bingxi Zhao (Frank)
d0fb2c6c1c Merge branch 'dev' into main 2026-04-21 00:30:23 +08:00
Bingxi Zhao (Frank)
c4ab82ff8c docs: release notes for v1.2.1
- New `assets/releases/ver1-2-1.md` covering #348 (per-stage chat token
  limits), #349 (Regenerate across CLI/WS/Web UI), the regenerate UI
  harmony polish, and bug fixes #347 / #345 / #352.
- README release-notes block updated to surface v1.2.1 above v1.2.0.

Made-with: Cursor
2026-04-21 00:28:48 +08:00
Bingxi Zhao (Frank)
106a3b4cf0 polish(chat): i18n Regenerate button + restore popped assistant on reject
- Add i18n keys for the Regenerate action button (en: "Regenerate",
  zh: "重新生成") and switch `ChatMessages.tsx` from the hardcoded
  "Regenerate" string to `t("Regenerate")`, matching the existing
  `t("Copy")` pattern in the same row.
- When a regenerate request is rejected pre-flight (server returns a
  terminal `error` with `reason` = `regenerate_busy` or
  `nothing_to_regenerate`), the optimistic `POP_LAST_ASSISTANT` +
  `STREAM_START` placeholder is now rolled back via a new
  `RESTORE_ASSISTANT` reducer action. The popped message is kept in a
  per-key ref (`pendingRegenerateRef`) and cleared on `done` or any
  terminal result, so the transcript stays in sync with the server and
  the user doesn't silently lose their last reply.

Made-with: Cursor
2026-04-21 00:21:42 +08:00
Roman Barlos
0f6c81b732 feat(chat): regenerate last response (CLI, WebSocket, Web UI) (#349)
Rebased onto dev (post-#348) and resolved two UI conflicts (`web/app/(workspace)/chat/[[...sessionId]]/page.tsx` drops the now-dead `replaySnapshot` helper; `web/components/chat/home/ChatMessages.tsx` switches the last-assistant action button from the old `RotateCcw`/Retry to `RefreshCcw`/Regenerate). Smoke tests green (199 passed) and all required checks pass.

Merging: adds a `regenerate` capability wired through CLI (`/regenerate` · `/retry`), WebSocket (`type: "regenerate"`), and Web UI (per-message Regenerate button). Backend rolls back the trailing assistant via `SQLiteSessionStore.delete_message`, reuses `start_turn` through `_persist_user_message=False` / `_regenerate=True`, skips `memory_service.refresh_from_turn` on regeneration, and surfaces non-fatal `regenerate_busy` / `nothing_to_regenerate` errors. Also includes empty-response diagnostics in `_stage_responding`. 18 new tests.
2026-04-21 00:14:58 +08:00
Roman Barlos
444b12a6d9 feat(chat): make per-stage token limits and temperature configurable via agents.yaml (#348)
Rebased onto latest dev (post-#352) to pull in the lazy loguru import in `deeptutor/tutorbot/channels/manager.py`, which was the root cause of the smoke-test failures (unrelated to this PR's own diff).

Merging: adds per-stage `max_tokens` and `temperature` knobs under `capabilities.chat` in `agents.yaml`, bumps the `responding`/`answer_now` defaults from 1800 → 8000 to fix mid-sentence truncation on long answers, and keeps safe fallbacks in `_ChatLimits.from_config` for legacy configs. 10 new unit tests covering loader resolution and dataclass coercion.
2026-04-21 00:13:07 +08:00
Bingxi Zhao
1fa0c399d9 Merge pull request #352 from DarkGenius/fix/dark-code-block-text-contrast
fix(web): ensure readable text in dark code blocks on light theme
2026-04-20 23:52:34 +08:00