`DEEPTUTOR_CHAT_ENGINE=typescript-native` builds the app with `lazy=True`, and
in that profile RouterLoader stores routing patterns on a DeferredRouter
instead of the routers themselves, so `_router_loader.records` stays empty.
collect_api() reads the socket routes from those records because OpenAPI has
no socket namespace, so under that profile the artifact would lose all nine
paths.
Pin the eager loader before anything imports the app, the way
scripts/build_router_index.py already does. Verified by running `--check` in
both profiles: without the pin the lazy profile reports drift, with it both
report the committed surface.
The doc contract checks need the truth about what the CLI and the backend
actually expose. Reconstructing that from source with `ast` cannot see
registration that only exists at runtime (the imperative
`for action in (...): app.command(action)(...)` loop in deeptutor_cli/module.py,
`add_typer` aliases), so it has to guess and the guesses rot.
Export the surface from the live objects instead:
- CLI: `typer.main.get_command(app)` walks the Click tree, so loop-registered
commands, aliases and Typer's default naming all come out correctly.
- HTTP: `app.openapi()["paths"]`, which resolves include prefixes and expands
the lazy router loader.
- WebSocket: FastAPI omits socket routes from OpenAPI, so they come from the
repo's own `RouterLoader.records` joined with the manifest prefixes.
The artifact is committed at docs/tests/docs_surface.json and rendered
deterministically (sorted, indent=2, trailing newline), so `--check` is a
byte comparison. Nothing reads it yet; the next commits switch the tests over
and add the freshness gate.
20 CLI groups, 610 HTTP paths, 9 WebSocket paths as of this commit.
The lazy router index and pip --report plan.json are written as UTF-8,
but were read with the locale default; build_router_index.py now writes
UTF-8 explicitly so the read and write sides share one contract.
The extraction fix only helps material ingested after it lands, and the retry
endpoint covers web sources and media — an uploaded document cannot be
re-imported at all. scripts/reading_refresh_figures.py closes that gap:
--material/--all picks the PDFs, store.refresh_document re-extracts them in
place, and the same run can caption what the refresh produced.
--dry-run is strictly read-only (it works even when the store API is missing,
because the new calls are imported lazily), and any real run asks for
confirmation unless --yes is passed.
Ship a content workspace you choose, one exec tool for every language,
Mastery Path modes that gate its tools, and Settings that grades
readiness instead of listing faults.
Release notes: assets/releases/ver1-6-5.md
Partners stop being a deployment-wide admin resource and become
per-user: three nested rights (manage / use / neither) replace the
blanket admin gate on the router, each member can build and own their
own, and every person's conversations with a partner stay private to
their account. Grants keep working and now offer only admin-managed
partners. Channel runtime state moves from one directory per channel to
one per partner — copied, not moved, and only when its owner is
unambiguous — so two partners can finally run the same channel.
Around that: a knowledge base can track GitHub repositories and re-sync
their Markdown (#903); Antigravity CLI joins My Agents now that Gemini
CLI is retired (#828); personal WeChat signs in from a QR code drawn in
the browser instead of the server log (#951); a chat account can be
linked to a DeepTutor account with /link; containers re-apply the extras
they declare instead of losing them at compose down (#762); and
`deeptutor doctor` answers whether a workspace is ready to run (#959).
Reliability, largely from community PRs: embeddings survive a
rate-limited provider through key rotation, a retry budget and a global
throttle (#962); MinerU parsing and code execution work on Windows
(#844, #964); indexing fails bounded instead of hanging (#946); MinerU
page-layout blocks stop being indexed as content (#949); voice uploads
carry a MIME the transcription API accepts (#945); and reasoning effort
can be overridden per conversation (#641).
Release plumbing: notes in assets/releases/ver1-5-17.md, v1.5.13
archived, __version__ 1.5.17, README Releases row and all eleven
translations synced.
Two defects found by the release gate and fixed here:
- Six partner routes — the four channel-onboarding endpoints and both
WeChat QR endpoints — kept the _auth-only mount they had inherited
from the blanket admin gate, so any signed-in account could start a
QR login for someone else's partner and write a bot token into its
channel config. All six now declare _MANAGEABLE, and a sweep test
asserts no {partner_id} route is left ungated.
- A configured api_key became `str | list[str]` when key rotation
landed, but ten call sites pass it somewhere that takes one key; a
list would have rendered into an Authorization header verbatim.
keypool.primary_api_key reduces at each boundary.
Gates: pre-commit (all 15 hooks), ruff check + format, pytest
5276 passed, web 605 node tests, docs build.
Register Gemini as a first-class embedding provider with endpoint/env defaults, expose it in start_tour embedding selection, and add regression coverage for runtime resolution and wizard options
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
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.
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.
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.
On macOS with Homebrew Python, `Path(sys.executable).resolve()` follows
the venv symlink back to the system interpreter. PEP 668 then blocks
pip installs with "externally-managed-environment", causing the setup
tour to fail.
Swap the check order so the unresolved venv path is preferred when it
exists, falling back to the resolved path only when necessary.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>