Commit Graph

103 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
96a3b5db6b refactor(knowledge): unify all manager JSON writes on services.file_io atomic writer
Follow-up to #619: every kb_config.json / metadata.json write in
KnowledgeBaseManager now goes through atomic_write_json (temp file +
fsync + os.replace) instead of the truncate-then-lock pattern, so a
crash mid-write can no longer leave a truncated config and concurrent
readers always see a complete previous or new file. The JSON variant
in services.file_io gains the same tolerant fsync as its text sibling,
the now-redundant private helper and dead file_lock_exclusive are
removed, and the atomicity-contract test moves next to the shared
writer in tests/services/test_file_io.py.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 00:50:07 +08:00
Bingxi Zhao
9379e78018 Merge pull request #628 from xor-xe/fix/624-mineru-image-paths
fix: resolve relative img_path in parsed content lists to absolute paths
2026-07-19 00:32:28 +08:00
Bingxi Zhao (Frank)
fb3c568697 fix pageindex & minor bugs 2026-07-18 19:47:03 +08:00
BukeLy
3288ce7931 refactor(pageindex): trim review findings — drop redundant dir resolution in search, dedupe deferred_tools() call, inline blocklist, fix stale docstrings 2026-07-15 18:30:04 +08:00
BukeLy
2e82ad4d27 feat(pageindex): agentic retrieval via MCP tools + full document-endpoint format support
PageIndex deprecated its REST retrieval endpoint; deep retrieval is now
agentic through the hosted PageIndex MCP server, while search() serves
programmatic callers with real document tree outlines.

- New built-in "pageindex" MCP server entry, code-injected at manager load
  when an API key is configured (never persisted to mcp.json; user-defined
  entry wins; hot-reloads on key change). remove_document is blocked via a
  new MCPServerConfig.disabled_tools blocklist.
- Chat turns with a PageIndex KB attached get the server's tools preloaded
  under a narrowed implicit grant (KB access = permission), plus a system
  prompt block listing the KB's file -> doc_id manifest with usage notes.
  The rag tool's kb_name enum excludes PageIndex KBs (a pure-PageIndex
  conversation doesn't mount rag), so the agent reads those docs via MCP.
- PageIndexPipeline.search() now returns each document's tree outline
  (titles / pages / summaries) fetched over REST (GET /doc/{id}/?summary=true)
  as honest structural context for programmatic callers (book, co-writer,
  seed, CLI). No new error_type; existing not_configured / retrieval_error /
  needs_reindex semantics are unchanged. The dead REST retrieval client
  methods are deleted. Existing KBs need no migration.
- SUPPORTED_EXTENSIONS now mirrors POST /doc/: pdf, md, markdown, txt, docx,
  doc, pptx, ppt, xlsx, xls, csv (zip stays a local container); frontend
  format list + copy updated (en/zh).
2026-07-15 18:21:43 +08:00
xor_xe
68613a6418 fix: resolve relative img_path in parsed content lists to absolute paths
MinerU emits img_path entries like images/x.png relative to the
content-list file inside the parse cache. RAG-Anything resolves them
against its own working directory, so the vision stage cannot open the
images when indexing with LightRAG. Anchor relative img_path values at
the content dir when loading the cached IR; the cached JSON itself stays
relative so cache dirs remain relocatable.

Fixes #624
2026-07-15 13:53:50 +04:00
Bingxi Zhao (Frank)
3d5b669cd3 minor fix 2026-07-04 15:49:11 +08:00
Bingxi Zhao (Frank)
bca6f6e983 release: v1.4.15
Native Mattermost channel for Partners (issue #590): a self-hosted
Mattermost server connects through its own v4 WebSocket + REST API
instead of the Slack-compatibility shim, reusing the existing
httpx + websockets transport.

Guided Learning multiple-choice questions now register every full option
body with mastery_quiz (not bare A/B/C labels), so grading is
deterministic and the saved Question Bank entry shows the real choices;
pre-existing paths recover option text from the original ask_user card.

A configured zero chunk_overlap (or chunk_size) on the LlamaIndex engine
is no longer coerced to the default 50.

Bundles the README Releases update, translated-README channel-list sync
(10 languages), release notes (assets/releases/ver1-4-15.md), version
bump to 1.4.15, and the ruff-format of the new Mattermost channel files.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 22:33:04 +08:00
Bingxi Zhao (Frank)
4fab448977 minor fix & new channel 2026-06-30 22:11:40 +08:00
VectorPeak
8ba7dd2f38 fix: preserve zero LlamaIndex chunk overlap 2026-06-30 10:32:34 +08:00
Bingxi Zhao (Frank)
3b823ae5f7 minor fixes 2026-06-29 23:06:30 +08:00
Bingxi Zhao (Frank)
30b92dfe86 release: v1.4.12
LightRAG Server retrieval engine, PyMuPDF4LLM document parsing, and a
FAISS vector backend that makes large knowledge-base retrieval far faster.
Drop-in — existing knowledge bases keep working; re-index to move onto FAISS.

- LightRAG Server: connect a KB to a standalone LightRAG server over HTTP
  (no local index); per-KB server URL + optional API key, always available.
- PyMuPDF4LLM: lightweight, image-capable parsing engine (no CUDA, no model
  downloads); background install from Settings → Document Parsing.
- FAISS: faiss-cpu + llama-index-vector-stores-faiss as core deps, lazy
  import with graceful SimpleVectorStore fallback (issue #552).
- Release notes (ver1-4-12.md), version bump to 1.4.12, README prose +
  Releases row, and all 10 translated READMEs synced.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 16:24:08 +08:00
Bingxi Zhao (Frank)
eef785ae1e integrate lightrag-server & other fixes. 2026-06-24 15:54:12 +08:00
Bingxi Zhao (Frank)
50e71249b0 Merge pull request #584 from TyrionH-is-coding/fix/siliconflow-native-tools
fix(llm): enable native tool calls for SiliconFlow

SiliconFlow is a registered openai_compat provider but had no
PROVIDER_CAPABILITIES entry, so it fell to the default supports_tools=False
and can_use_native_tool_calling() disabled native tool schemas — models
emitted textual <tool_calls> markup instead of executable calls. Register
SiliconFlow with native tool support; per-model overrides (DeepSeek
response_format / thinking tags) still apply.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 21:25:15 +08:00
Bingxi Zhao (Frank)
2dc4c7dd03 Merge pull request #543 from octo-patch/feature/upgrade-minimax-m3
feat: refresh MiniMax model identifiers in tests to M3

MiniMax-M3 is the current default on the MiniMax platform; refresh the
model-id strings used in the capability/runtime tests and add M3/M2.7
assertions. Provider capability resolution is keyed on the 'minimax'
prefix, so this is behavior-neutral (no production code changed).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 20:46:01 +08:00
TyrionH-is-coding
effbb82798 fix(llm): enable SiliconFlow native tool calls 2026-06-22 22:48:42 +08:00
Bingxi Zhao (Frank)
dfa0c9b1ea fix(deploy): wire DEEPTUTOR_* proxy env via single JSON-backed exporter
The PR's relative-path + proxy.ts rewrite design depends on two env vars
(DEEPTUTOR_API_BASE_URL, DEEPTUTOR_AUTH_ENABLED) read server-side by the
Next.js middleware. As submitted they were only set by the Docker entrypoint,
and the auth one read a non-existent auth.json key — so auth enforcement was
silently disabled and the PyPI `deeptutor start` path was unwired.

- Export both vars from render_environment() (the single JSON-backed source of
  truth), so the Docker entrypoint AND the `deeptutor start` launcher get them
  consistently. DEEPTUTOR_API_BASE_URL falls back to localhost:<backend_port>.
- launcher.py: set both in common_env using the resolved backend_url, so they
  track port-conflict reassignment.
- Dockerfile: drop the duplicated, buggy per-var heredocs (one read the wrong
  key `auth_enabled` instead of `enabled`, leaving the proxy auth gate always
  off); the export_runtime_settings_to_env eval now provides both. Add them to
  the env-unset list for hygiene.
- Update the two placeholder tests to assert the new proxy-based design instead
  of the removed build-time sed mechanism; add DEEPTUTOR_* coverage in
  test_runtime_settings.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 21:12:40 +08:00
Bingxi Zhao (Frank)
88c2565389 release: v1.4.8
Partners become consultable agents and gain their own memory.

- My Agents now lists your Partners next to local Claude Code / Codex;
  connect one and the turn runs on `consult_subagent` against the
  partner's own chat loop, streaming its trace live. Every consult in a
  DeepTutor chat threads into one archived partner session.
- Partners get a split memory model via three always-on tools that
  replace chat's read_memory/write_memory on partner turns:
  partner_read (owner shared + own), partner_memorize (own only),
  partner_search (own history). The per-Partner memory toggles are gone.
- A `partner:` history reference resolves a partner transcript
  (admin-only) into a DeepTutor chat as third-party context.

Release-prep fixes for a clean CI parity run:
- partner.py: replace mypy-misparsed `# type:` dict-entry comments with
  a proper variable annotation.
- claude_models.py: `# nosec B606 B607` on the PATH-resolved `os.execvp`
  in the forked PTY child (no shell; pre-existed since v1.4.7).

Bump __version__ to 1.4.8, add assets/releases/ver1-4-8.md, README row.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 22:16:31 +08:00
Bingxi Zhao (Frank)
7871955ab5 fix:partners & improve my agents 2026-06-18 22:00:59 +08:00
Bingxi Zhao (Frank)
1bf11d13e7 prepare 1.4.7 2026-06-18 00:22:48 +08:00
Bingxi Zhao (Frank)
7d3a06ca8f fix: repair v1.4.6 CI failures (lint + RAG/partner test isolation)
The v1.4.6 squash shipped three CI-red issues that the release pre-commit
gate could not see (ruff hook runs with --exit-zero; the release process
never runs pytest):

- partners WS chat referenced an undefined `mgr` (ruff F821, and a real
  runtime NameError on the partner WebSocket chat path) — bind
  `mgr = get_partner_manager()` in the handler, matching the file's idiom.
- GraphRAG initialize/search tests drove write_settings() through the real
  catalog, which has no active embedding model in CI — pin fake llm +
  embedding configs in `_stub_build`, the same way the LightRAG test does.
- PageIndex `test_factory_dispatches_by_provider` constructed a real
  LlamaIndexPipeline whose __init__ resolves the embedding catalog — stub
  `_configure_settings`, matching the LlamaIndex pipeline tests.
- New `test_chat_does_not_auto_start_stopped_partner` spawned a real
  PartnerRunner task and cancelled it across TestClient per-request event
  loops — drive the start/stop/chat sequence through one shared loop via a
  context-managed TestClient.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 11:28:18 +08:00
Bingxi Zhao (Frank)
7ac3a3ba79 release: v1.4.6
A broad consolidation release across four product surfaces.

- Learning Space: Space becomes a learning dashboard; My Agents imports
  local Claude Code / Codex chat history into resumable agents (with an
  objective explore_context briefing so the tutor never role-plays the
  user); Memory is promoted to a top-level /memory route; Partner
  conversations flow into Memory; EduHub skills install inline.
- Knowledge Center: /knowledge rebuilt as a console with per-engine
  detail pages; GraphRAG / PageIndex / LightRAG engines join LlamaIndex;
  linked-KB read-only mounts; Obsidian live-vault capability.
- Settings: pluggable document parsing (MinerU / Docling / MarkItDown)
  with a content-addressed cache and MinerU cloud/local backends; voice
  TTS/STT; image & video generation; rebuilt settings navigation.
- Platform: per-user capability gating by assigned model; Solve rebuilt
  on the chat loop with a per-step gate and mid-run failure fallback;
  username login + inline errors; CLI skill publish/update; picker
  polish; math-before-citation render fix.

Docs were split out to a standalone site, so site/ is now landing-page
only. Bumps __version__ to 1.4.6 and adds assets/releases/ver1-4-6.md.

Folds in mypy fixes surfaced by pre-commit (mineru/local Path typing,
knowledge/manager no-redef, explore_context token kwargs, CLI
set_dist_tag capability probe) plus prettier reformatting of
previously-committed web files.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 10:50:44 +08:00
Bingxi Zhao (Frank)
7ed16cf48a update tests 2026-06-17 10:30:25 +08:00
Bingxi Zhao (Frank)
c9d387e2b6 super super great great update 2026-06-17 00:56:27 +08:00
Bingxi Zhao (Frank)
171b1cc2d2 release: v1.4.4 — ClawHub skill hub, real KB document previews
A focused cut on top of v1.4.3:

- Skill hub: install community skills from ClawHub (and any compatible
  registry via settings/skill_hubs.json) — provider abstraction in
  services/skill/hub.py, new `deeptutor skill search/install/list/remove`
  CLI, admin-only install endpoint for multi-user (install ≠ assign).
  Every import runs a security gate: hub verdict check, zip-slip/zip-bomb
  guards, text/script suffix whitelist, `always:` frontmatter stripped,
  provenance recorded in .hub-lock.json.
- KB previews: new /knowledge/{kb}/file-preview-text/{filename} endpoint
  serving extracted plain text; KB Files tab renders real in-browser
  DOCX/XLSX previews; DOCX previewer scales pages to fit narrow panels.
- Markdown previews allow safe raster data:image URLs on <img src>
  (react-markdown strips all data: URLs by default); script-capable
  schemes stay blocked.
- All ten localized READMEs re-synced with the English README.
- Docs (deeptutor.info): `deeptutor skill` reference, hub-install notes on
  Space and multi-user pages, KB file routes in the server API table
  (en + zh).
- CLI docs contract test updated for partner/skill subcommands.

Release notes: assets/releases/ver1-4-4.md

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-13 03:58:28 +08:00
Bingxi Zhao (Frank)
452de66729 release: v1.4.3 — TutorBot→Partners, single-loop Chat, real multi-user isolation
The biggest cut since v1.4.0:

- Partners: TutorBot renamed and rebuilt on the product chat agent loop —
  production IM pipeline (retry/dedup/coalescing, per-channel delivery),
  live streaming on Telegram/Discord/Feishu, new WeCom AI Bot channel
  (15 connectors), web-chat attachments, soul template library + editor.
  Automatic non-destructive migration from data/tutorbot/; HTTP API moved
  to /api/v1/partners.
- Chat: single exploring agent loop with native tool calling; Activity
  header with collapsible thinking/tool trace.
- Multi-user: per-user grants v2 (tools/MCP/exec), data/users + data/system
  layout with automatic migration, runner mounts only the user workspace.
- Visualize: inline themed SVG, structured prompts, local validate+repair
  replacing the LLM review round.
- Co-writer Mermaid diagrams + selection RAG/web; file viewer docx/xlsx
  previews; MinerU cloud parsing backend; office skills on by default;
  CLI chat renderer rewrite.
- Docs rebuilt at deeptutor.info: per-channel setup guides (en+zh),
  refreshed screenshots.
- Pre-commit clean sweep: defusedxml for SVG validation, usedforsecurity
  flags on content hashes, mypy fixes, types-croniter stub.

Release notes: assets/releases/ver1-4-3.md

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 17:17:43 +08:00
Bingxi Zhao (Frank)
062f401195 feat(partners): live streaming for telegram/discord/feishu + unavailable-channel surfacing
- telegram: send_delta via progressive edit_message_text (throttled,
  flood-control retry, HTML final render, mid-stream overflow split)
- discord: send_delta via REST POST/PATCH with rate-limit retry; send()
  now raises on failure so the manager retry applies
- feishu: send_delta via CardKit streaming cards (create → sequenced
  stream updates → close streaming_mode, regular-card fallback)
- registry: discover_all_with_errors keeps import-failed channels
  diagnosable; schema API marks them available:false with the reason;
  UI grays them out and shows the missing-dependency message instead
  of silently dropping them (the "why is X missing?" class of bugs)
- 10 new streaming contract tests; 343 partner tests green; tsc clean

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 22:39:49 +08:00
Bingxi Zhao (Frank)
6d4dd15d78 update 2026-06-11 20:15:48 +08:00
Bingxi Zhao (Frank)
46093e5e2b update msg 2026-06-11 20:03:34 +08:00
Bingxi Zhao (Frank)
da1061910b feat(partners): production IM infra — retry/dedup/coalescing, per-channel delivery flags, stream-delta protocol, slack/telegram connection fixes
- manager: exponential-backoff retry (send_max_retries), origin-scoped
  duplicate suppression, _stream_delta coalescing, per-channel
  send_progress/send_tool_hints gating (global AND channel override)
- base: send_delta/supports_streaming protocol, _wants_stream injection
- runner: live stream segments per loop round (turn_id:call_id), narration
  rounds freeze on completion, final reply marked _streamed when delivered
- telegram: split API/polling HTTPX pools (pool exhaustion fix), trim
  legacy nanobot command menu, raise on send failure for manager retry
- slack: Socket Mode handshake timeout + WSS diagnostics, send raises
- schema: DeliveryOverrides/StreamingSupport mixins on channel configs
- partners/network.py: strict SSRF validator for channel media downloads
- icons: correct WeCom mark (TDesign outline, official brand palette)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 17:43:08 +08:00
octo-patch
dbf1f85c92 feat: upgrade MiniMax default model to M3
- Update sample test models from MiniMax-M2 / MiniMax-M2.7 to MiniMax-M3
- Extend capabilities test to cover M3 alongside M2.7 / M2.7-highspeed
- M3 introduces a 512K context window, 128K max output, and image input support
- Older models (M2.5/M2.1/M2/M1) are no longer first-class targets
2026-06-03 22:06:38 +08:00
Bingxi Zhao (Frank)
1946ae8182 refactor(book/session/zulip): post-merge hardening of #493/#529/#484
#493 (sqlite): route _initialize() through the _connect() contextmanager
(the one remaining raw sqlite3.connect FD leak); document the auto-commit
contract so the redundant explicit commits are understood.

#529 (book):
- _strip_thinking_preamble: guard `{ not in text` before rindex() so plain
  prose (refusals/errors) no longer raises ValueError -> ERROR block;
  hoist json import to module top.
- llm_json: honor caller max_tokens as max(max_tokens, 2600) instead of
  discarding it; bump default to 2600; fix stale 'minimal' docstring -> 'low'.
- engine.compile_page: rebuild OVERVIEW pages deterministically via
  _materialize_overview_page on force, instead of running the generic LLM
  compiler over hand-built intro/concept-graph/index blocks.
- kb_health.scan_log_health: key repeated-failure detection on the op, not
  the free-text message, removing false positives/negatives + dead block_error.
- services/__init__: drop orphaned notebook_manager lazy-import + __all__ entry.
- PageReader.tsx: restore t() i18n on regenerate buttons; add 'Regenerating…'.
- remove PATCHES.md (developer-local scratch notes).

#484 (zulip): also match the disambiguated @**Name|user_id** mention form;
make the docstring truthful; add coverage.

#500: remove stray PR_DESCRIPTION.md committed to repo root.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 14:07:02 +08:00
Bingxi Zhao (Frank)
e5846fe462 Merge pull request #484: Zulip Generic-bot @mention content fallback
Generic bot + Event Queue API returns an empty flags array, so flag-only
mention detection never fires. Add a content fallback that scans the message
body for the rendered @**Bot Full Name** syntax, backed by a _bot_full_name
captured from the bot profile. Resolved against dev's MENTION_FLAGS constant
and structured logging; added content-fallback test coverage.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 13:38:25 +08:00
Bingxi Zhao (Frank)
c4d47668b7 release: v1.4.2 — Gemini 2.5+ unblocked, auth ContextVar fix, smooth streaming everywhere
- Centralize Gemini 2.5/3 reasoning_effort=none in
  reasoning_params.default_reasoning_effort_for so Visualize / Chat /
  Solve / agentic loop stop returning empty bodies on those models.
- Visualize: per-capability max_tokens default (16k) seeded from
  DEFAULT_AGENTS_SETTINGS, defensive root-tag trim on SVG/HTML output,
  graceful fallback when JSON-mode review step crashes.
- Fix #485: require_auth / require_admin are async so the
  set_current_user ContextVar reaches the endpoint instead of being
  discarded by anyio.to_thread.run_sync's worker-thread context copy.
  Adds _install_current_user helper shared by HTTP + WebSocket.
- Reasoning + native-tools chat protocol: formal content stream must
  still start with FINISH/TOOL/THINK/PAUSE; tool-call deltas no longer
  force-resolve labels and implicit_think_label is ignored, so
  protocol-repair catches missing labels instead of mis-routing turns.
- Smooth streaming on every chat surface: useSmoothStreamText through
  AssistantResponse, pin-to-bottom (useLayoutEffect) on book chat +
  quiz follow-up, data-chat-scroll-root opt-in for overflow-anchor:none.
- Sidebar: collapsible Recents region with own scroll viewport,
  deterministic Lucide icon per session via SessionAvatar, Docs link
  next to GitHub footer, "New Chat" button removed (nav handles it).
- Add Lemonade local provider (port 13305) — registry entry, README
  Docker host-gateway row, providers.md docs.
- Context-window models-endpoint probe honors DISABLE_SSL_VERIFY via
  TCPConnector(ssl=False).
- README: insert v1.4.2 release row, push v1.3.10 inside "Past
  releases" fold, bump install opt-in note to v1.4.2.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 22:36:21 +08:00
Bingxi Zhao (Frank)
db41c574a1 refactor: centralize Gemini default-off reasoning in reasoning_params
Follow-up to #490. The PR inlined the "disable thinking for Gemini 2.5/3"
gate in 5 places across 3 files. This commit collapses them to one
registry and three thin call sites.

Changes:

* `services/llm/reasoning_params.py`: new `_PROVIDER_DEFAULT_OFF_PATTERNS`
  registry + `default_reasoning_effort_for(provider, model)` public helper.
  `build_openai_compatible_reasoning_kwargs` now consults the registry, so
  the openai-compat path (which lost its inline gate during the #490 merge
  conflict resolution) is restored via the helper.

* `services/llm/executors.py` (sdk_complete + sdk_stream) and
  `services/llm/cloud_provider.py` (_openai_complete + _openai_stream) now
  call `default_reasoning_effort_for(...)` instead of inlining the
  ('gemini-2.5', 'gemini-3') startswith check.

* Use substring (not startswith) match so `models/gemini-2.5-flash` is
  also covered — some OpenAI-compat clients prefix model ids with `models/`.

* `services/config/loader.py:get_agent_params`: when a module's section is
  missing from the user's stale `agents.yaml`, fall back through
  `DEFAULT_AGENTS_SETTINGS` before the global `(0.5, 4096)` default. This
  lets the `capabilities.visualize` default (`max_tokens=16384` from #490)
  reach existing installs, not just fresh ones.

* `capabilities/visualize.py`: hoist the duplicated lazy
  `from deeptutor.agents.visualize.models import ReviewResult` import
  from two branches into the top of `run()`.

Tests:

* `tests/services/llm/test_reasoning_params.py` — 17 new cases covering
  Gemini 2.5/3 + `models/` prefix + case-insensitivity + the legacy
  Gemini 1.5/2.0 / other-provider untouched paths + the explicit-override
  takes-precedence rule.
* All 107 tests in `tests/services/llm/` still pass; 5 pre-existing
  `test_chat_params_config` failures (8192 vs 8000 drift) are unrelated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 18:00:08 +08:00
Bingxi Zhao (Frank)
6c024857b7 release: v1.4.1 — security & stability patch
Security: lock down the TutorBot tool sandbox (shell exec is opt-in, all
filesystem/shell access confined to the bot workspace) and isolate per-user
resources, closing #518, #517, #516, #515, #514 and #506 (first hardened in
#507).

Bug fixes: chat input disabled after the first turn (#520), KB embedding
failure on long documents (#521 / #509), profile creation under Docker
(#512 / #513), Qwen reasoning models failing native tool calling (#527 / #528),
the GPT-5 init-wizard token parameter (#508), and oversized session-event
truncation (#524).

Features: HTTP/SSE API for multi-turn chat with a specific TutorBot (#511),
multimodal image fallback for vision-capable providers without a capability
entry, safe ZIP knowledge upload, and a /settings/network page with model
fetching (community PRs #522 and #523 reimplemented locally).

Also bumps __version__ to 1.4.1, adds the v1.4.1 release notes, updates the
README Releases section, and ships the Astro + Starlight docs site under site/.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 23:16:00 +08:00
Bingxi Zhao (Frank)
6153d8c092 release: v1.4.0 — release notes, version bump, repo hygiene
- Add assets/releases/ver1-4-0.md covering deltas since v1.4.0-beta
  (reasoning_effort normalization, tool-schema fallback, restart-safe
  turn runtime, frontend placeholder hardening, CLI chat REPL config).
- Bump deeptutor/__version__ to 1.4.0.
- Update README Releases section: v1.4.0 at top, install opt-in note
  updated for stable.
- Fix pre-existing pre-commit failures so the v1.4.0 cut runs clean:
  bandit B324 (mark _sha1 as non-security), mypy no-redef in
  document.py / line_doc.py, mypy arg-type/assignment in
  snapshot/adapters.py, mypy assignment + arg-type in
  services/memory/settings.py, mypy func-returns-value on
  set.add idiom in deeptutor_cli/init_wizard.py.
- Apply ruff format / prettier sweep across the repo.
- Remove stale workspace + i18n env example + playwright captures
  already cleaned locally; ignore .playwright-cli/ going forward.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 21:09:22 +08:00
Bingxi Zhao (Frank)
ca7916bc57 fix: docs, docker deployment & official web 2026-05-22 20:19:32 +08:00
Bingxi Zhao (Frank)
206b775ad4 fix: unblock v1.4.0-beta release — Docker build + CI test alignment
web/lib/api.ts: defer NEXT_PUBLIC_API_BASE placeholder check from
module-load to first call. Docker bakes the literal placeholder for
runtime sed substitution, but Next.js evaluates this module during
static export of every prerendered page — the old throw failed the
admin/users page export and aborted the entire build.

Test alignment with shipped code (no behavior change):
- test_path_service: override _workspace_root alongside _project_root,
  since get_memory_dir() reads workspace_root, not _user_data_dir.
- test_meta_settings: assertions now match shipped defaults
  (l2_budget=20, min_chunk_chars=1000, max_chunk_chars=64000).
- test_unified_ws_turn_runtime + test_regenerate: drop emit_calls
  assertions; turn_runtime doesn't emit a memory trace after chat
  turns (feature was never wired up).
- test_turn_runtime_subscribe: 200 polls × 10ms instead of 20 × 0,
  Python 3.14's asyncio scheduler doesn't give sleep(0) enough ticks
  for the subscriber-append race.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 00:21:41 +08:00
Bingxi Zhao (Frank)
90a2c14c81 chore: backend + frontend follow-ons for v1.4.0-beta
Wires the new memory / capability / settings / quiz subsystems into
existing surfaces and finishes the chat-pipeline follow-on work.

Backend:
- Session services pick up the cumulative source inventory + new tool
  tags (turn_runtime, sqlite_store, pocketbase_store, protocol,
  base_session_manager).
- LlamaIndex RAG pipeline config / document_loader / retrievers
  tightened; rag/service.py routed to match.
- Sessions / unified_ws / settings / notebook routers updated for
  delete-chat-turn, multi-user, and the new tool surface.
- TutorBot manager + Zulip channel + openai_compat_provider follow-on
  fixes layered on top of the v1.3.10 SSL/Zulip sweeps.
- runtime/{banner, launcher, orchestrator}, services/setup/init,
  prompt/manager, json_parser refined for the runtime-settings
  rewrite.

Frontend:
- Co-Learn pages and session-surfaces removed (folded into chat).
- Chat composer / messages / trace / session panels, sidebars,
  common modals, markdown renderers, and i18n updated for the new
  ask_user / write_note / source-inventory flow.
- Admin, agents, co-writer, playground, book pages picked up the
  shared updates.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 18:08:22 +08:00
Bingxi Zhao (Frank)
acd0d9329d feat(capabilities): unify infra, merge Animator into Visualize, split settings UI
Capability infrastructure:
- New capabilities/_shared.emit_capability_result helper fills the
  result envelope (label, summary, payload, render hints, UsageTracker
  totals) consistently across modes.
- StatusI18n loads capability status copy from
  capabilities/prompts/{en,zh}/<name>.yaml; legacy main.yaml strings
  removed.
- New capabilities_settings router + service-config module power the
  /settings/capabilities admin page (live capability list, defaults,
  per-capability overrides).

Visualize + Animator merge:
- Visualize's AnalysisAgent now picks one of six render_types:
  svg / chartjs / mermaid / html (text pipeline) or manim_video /
  manim_image (Manim subprocess). The result envelope carries
  render_type so the frontend delegates to the right viewer.
- math_animator capability is folded behind Visualize; the standalone
  MathAnimatorConfigPanel.tsx is removed. The Animator sidebar entry
  is gone, but Manim outputs and existing records remain unaffected.

Settings UI:
- /settings page split into appearance / capabilities / embedding /
  llm / mcp / memory / search / status / tools tabs with a shared
  layout and items index.
- New /settings/tools page lists chat-mountable tools and surfaces
  availability (e.g. gh for github_query) via a new tools router.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 18:06:14 +08:00
Bingxi Zhao (Frank)
7bdb10b700 feat(chat): Auto mode router + new chat tools (ask_user, web_fetch, etc.)
Auto capability (agents/auto/) gains a three-stage agent loop:
ANALYZING (one LLM call, streamed as thinking) -> DELEGATING (router
emits delegate_to_<cap> tool calls or atomic tool calls, with bounded
retries and a same-cap quota) -> SYNTHESIZING (final inline answer).
Sub-capability events flow through forward_events with call_id tagging
so conversation history keeps only Auto's own synthesis.

New chat-mountable tools:
- ask_user: pauses the turn for 1-3 structured questions, frontend
  renders a card the user navigates and submits in one batch
- web_fetch: HTTP + readable-content extraction with strict
  scheme/private-IP/size guards (pre-flight + post-redirect)
- write_note: replaces save_to_notebook; append (new record) and
  edit (existing record by id) modes
- list_notebook: read-only index / drill-down listing; only mounted
  when the user has notebooks
- github_query: read-only ``gh`` CLI wrapper (pr/issue/run/repo plus
  GET-only api); no mutation verbs reachable

Updates chat agentic_pipeline.py + agentic_chat.yaml (en/zh) to the
new tool surface and source-inventory contract, refits
tools/builtin/__init__.py as the single place to register
chat-mounted tools and their argument-augmentation wrappers, and
tightens core stream + tool_protocol around tool-result metadata.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 18:05:15 +08:00
Bingxi Zhao (Frank)
2b7242081f feat(memory): three-layer memory subsystem (L1/L2/L3) with workbench
Replaces the flat single-blob memory page with a structured store:
- L1 captures raw run traces; L2 holds normalized document records;
  L3 holds curated slots per surface (chat, notebook, book, TutorBot).
- New consolidator pipeline (chunker, guards, parse, references, runs,
  modes, line-doc, meta) turns traces into versioned line-oriented
  documents with stable ids and snapshot history.
- Per-user isolation flows through PathService; the store API is
  stateless.

UI ships a dedicated /memory workbench with graph / L1 / L2 / L3 /
resolve subpages, plus a reusable MemorySection embedded where the
legacy panel lived.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 18:02:32 +08:00
Bingxi Zhao
cade7897f4 Merge pull request #480 from wedone/fix/zulip-upload-and-send
fix(zulip): 修复 Zulip 通道附件上传与消息发送的 BUG,支持 Bot 自动订阅频道
2026-05-15 00:12:08 +08:00
WeDone
ac06a05e22 fix(zulip): 支持所有mention flags类型修复频道@mention无响应问题
问题:在Zulip频道中@机器人没有反应,私聊正常。
根因:_is_mentioned方法只检查mentioned flag,遗漏了
      wildcard_mentioned、stream_wildcard_mentioned、
      topic_wildcard_mentioned等通配符mention标志。

修改:
- _is_mentioned支持所有四种mention flags
- 增强日志输出便于排查问题
- 补充边界测试用例(flags缺失、非字符串元素等)
2026-05-14 11:37:06 +08:00
iwedo
9f6ebe91ba feat(zulip): 支持Bot自动订阅频道以接收话题中的@mention消息
问题:在Zulip话题中@机器人没有反应,deeptutor容器无日志。
根因:Bot未订阅频道,Zulip服务器不会推送频道消息事件给未订阅的Bot。

主要修改:
- ZulipConfig新增subscribe_streams配置项,支持指定频道名或通配符'*'
- start()中新增_subscribe_to_streams()自动订阅频道
- _subscribe_to_streams()支持异常保护,订阅失败不阻断Bot启动
- 通配符'*'与显式频道名混合使用时合并处理
- _on_message()添加调试日志便于排查
- _bot_full_name属性用于后续@mention内容匹配

测试修复:
- TestDownloadAttachments添加get_media_dir mock解决yaml导入错误
- TestUploadAndSend改用call_args_list筛选上传调用修复KeyError
- 新增TestSubscribeStreams测试类(7个用例)
- 将test_stop_cancels_typing_tasks移至TestStop类
2026-05-14 10:29:44 +08:00
WeDone
33aeab41a3 test(zulip): 添加附件上传与发送修复的单元测试
修复现有 test_upload_uses_call_endpoint 测试(使用临时文件替代不存在的路径),新增测试覆盖:- _resolve_media_path: 本地路径直返、Zulip 路径缓存查找、Zulip 路径下载、完整 URL 解析、无效路径返回 None- _upload_and_send: 传递文件对象而非字符串、无法解析路径时跳过- send 元数据补全: 从 _recipient_map 补全缺失路由信息、已有元数据不被覆盖- send _tool_hint 过滤: tool_hint 消息被跳过、普通 progress 消息正常发送
2026-05-14 10:29:44 +08:00
Bingxi Zhao (Frank)
1596807242 refactor chat capability & RAG pipeline(llamaindex) 2026-05-13 21:36:07 +08:00
Bingxi Zhao
06f80c393f Merge pull request #465 from truffle-dev/fix/disable-ssl-verify-sweep
fix(ssl): extend DISABLE_SSL_VERIFY coverage to codex provider and four embedding adapters
2026-05-12 15:28:20 +08:00
Bingxi Zhao (Frank)
3d5c3a1eb5 improve chat 2026-05-12 02:20:30 +08:00