29 Commits

Author SHA1 Message Date
zszz3
35af647b48 refactor: drop the partner skills-manifest helper only a test used
_build_skills_manifest joined the two parts of _build_skill_context back
into one string; since skills became a runtime snapshot nothing calls it
except a test, which now checks _build_skill_context directly.

Refs #2973
2026-11-30 13:58:21 +08:00
zszz3
20bbe5e5fe fix: list only usable skills, as a runtime snapshot 2026-11-29 16:32:47 +08:00
Bingxi Zhao (Frank)
4d7090447e Integrate Turkish across complete locale chain, runtime messages and desktop shell 2026-10-31 18:14:34 +08:00
Bingxi Zhao (Frank)
0e84ab77fa Integrate reviewed changes and complete Portuguese translations 2026-10-31 18:04:54 +08:00
Bingxi Zhao (Frank)
3e281ce55b Complete and validate Brazilian Portuguese localization 2026-10-31 17:26:17 +08:00
Antonio-Faure
28d86973a4 fix(i18n): complete the French catalog and follow it for partner replies
- add the 760 English keys missing from the French catalog and translate 229 values still copied from English\n- make a partner's empty reply language (Auto) follow the account model output language instead of hardcoding English\n- label Auto with the configured language and offer every supported response language in the picker\n- localize the Feishu thinking notice for every supported response language\n- add French catalog, picker and partner runtime regression tests
2026-10-30 18:02:55 +01:00
Bingxi Zhao (Frank)
e347c0c2e0 fix: preserve tutoring replies and stabilize preview runtime
Keep learner-facing explanations visible across finish checks, persistence, and replay. Remove mastery prose heuristics and prioritize learner objections.

Coordinate service shutdown and descendant cleanup, and preserve video lesson identity and playable results across chat completion and reload.
2026-10-27 17:58:46 +08:00
zhujia
d1fe4f637d fix(feishu): keep replies in step with the turn
The channel trailed the model by up to 20s and finished long after the WebUI.
Every sync SDK call opened a fresh connection (DNS + TCP + TLS ≈2s per call)
and the serial outbound lane paid it per message.

- route lark-oapi's sync calls through one keep-alive session per worker
  thread: measured 2.03s → 0.68s per call (0.55s warm)
- create the streaming card carrying its first text instead of pushing that
  text in a second API call
- ask CardKit for a printable pace (streaming_config) instead of the platform
  default of one character per 70ms
- stop retrying card creation on every delta; after three failures the reply
  falls back to a regular card instead of dribbling out
- throttle stream edits to 1s so the lane stays ahead of the model
- make group threading configurable, and always reply flat in single chats
- post a brief "thinking…" notice while the model reasons and retract it once
  the answer starts: reasoning events never reach a channel, so such a turn
  used to look dead
- close the SDK WebSocket client on stop, so a reload cannot leave a second
  listener subscribed to the same app
2026-09-30 16:25:08 +08:00
XuanDu
a988f88778 fix: preserve generated partner attachments 2026-09-25 19:35:32 +08:00
Bingxi Zhao (Frank)
44a76ed0a9 feat(partners): add provider-first Feishu model picker 2026-09-23 12:37:45 +08:00
Bingxi Zhao (Frank)
f14e8e065d feat(feishu): deliver threaded replies and private model picker (#1517) 2026-09-23 12:08:17 +08:00
Bingxi Zhao (Frank)
da856ad670 release: v1.6.9
Ship folder-based workspaces and data migration, daily practice, redesigned
provider and model settings, and streaming conversation improvements.
Synchronize README translations and document the archive/permanent-delete
upgrade behavior in assets/releases/ver1-6-9.md.

Reduce initial JavaScript by deduplicating English resources and loading
animation features after hydration. Keep the existing route size budgets.
Update regression fixtures and browser audits for scoped URLs and the new
settings and learning interfaces.
2026-09-21 02:30:40 +08:00
Bingxi Zhao (Frank)
367195b7cf Merge remote-tracking branch 'origin/dev' into dev
# Conflicts:
#	deeptutor/api/routers/reading_extensions.py
#	tests/reading/test_extension_router.py
#	web/locales/en/app.json
#	web/locales/zh/app.json
2026-09-19 16:41:12 +08:00
Bingxi Zhao (Frank)
c547a5a31c fix: resolve verified learning, ingestion and delivery regressions
Bind mastery drafts before their opening turn and preserve stored session modes.
Track chat duration from submission through terminal completion. Run async reading
extensions on their event loop and allow retries after cancellable timeouts.
Allow first uploads into empty LlamaIndex knowledge bases, preserve Telegram
thread routing, parse embedding Retry-After dates, and enforce robots rules and
host pacing during documentation crawls, including redirects.

Fixes #1461
Fixes #1458
Fixes #1451
Fixes #1448
Fixes #1392
Fixes #1429
Refs #1435, #1412

Reuses contributions from PRs #1462, #1452 and #1403.

Co-authored-by: sjagadee <srini.jagadeesh@gmail.com>
Co-authored-by: AoHanBei <dongaohan21@gmail.com>
Co-authored-by: Gao-Chenkai <DevChenkai@outlook.com>
2026-09-15 20:06:57 +08:00
Bingxi Zhao (Frank)
541b7f4f16 feat(chat): let a turn read as a running account instead of an answer with hidden working
Every round already streamed its text to the reader. The loop then took it
back: a round that called tools was marked narration, and the client moved
that prose out of the answer and into a collapsed block pinned to the top of
the message. The reader watched a sentence appear and vanish, and what was
left was an answer with no account of how it was reached.

That behaviour came from one field doing two jobs. ``call_role`` said both
where the turn was and whether the text counted, so "more work follows" and
"hide this" could not be told apart — and three separate exceptions had grown
to say "actually, show this one" for DSML, truncation and mastery.

Split the two facts. ``call_role`` keeps the phase. A new ``answer_visible``
carries visibility, true for every ordinary round, false only where a
capability's finish guard retracts a round it rejected. The three exceptions
disappear with the default they were fighting.

The client then lays the message out in the order it was written: the sentence
that introduced a step, the step's own row beneath it, what the next round
said below that. A settled turn is restored from an event preview that carries
no text, so tool calls now record how much of the answer had been written when
they ran, and the stored body is laid back out around them.

The prompt asks for the commentary this depends on, and says the closing
answer should not replay it.
2026-09-11 16:49:40 +08:00
ZQR1101
ed6b5da1b9 feat(partners): record wrong questions into the question bank (#1244) 2026-09-10 01:48:52 +08:00
Bingxi Zhao (Frank)
abd7fbcdce fix(partners): show which chat a partner conversation came from
One partner serving three study groups plus DMs rendered as a flat list
where every row looked like a private chat: the only label is the
opening message, which in a group is one student's question (#1229). The
data was never lost — sessions are already one file per chat — it just
never reached the list.

The channels state the kind of conversation on the inbound event and
DeepTutor was dropping it: Feishu sends ``chat_type`` ("group" / "p2p"),
Slack and Mattermost send ``channel_type``. Delivery is the only moment
this is known for certain, so the turn records it, and the summary reads
it back. No prefix sniffing, no lookup on the read path, and nothing has
to import a channel to render a list.

``conversation_scope`` is the single place those three vocabularies
become the two words a reader cares about. A channel that says nothing —
or says something new — yields no label at all, and the row renders as
it always did; a list that guesses is worse than one that stays quiet.
Sessions written before this carry no origin and are likewise unlabelled
rather than marked "unknown".

This is the distinction the report called the minimal useful fix.
Resolving a Feishu group's *name* through the chats API, which is what
it asked for first, is left out on purpose: it needs a call and a cache
I cannot exercise against a real tenant here.

The regenerated contract picks up ``/api/knowledge-bases/delete`` as
well — the committed schema was already behind by that route before this
change, and the file is generated, so it comes back whole.
2026-09-08 10:09:19 +08:00
Bingxi Zhao (Frank)
02ba56793e chore: checkpoint backend stabilization workspace 2026-09-01 21:28:15 +08:00
Bingxi Zhao (Frank)
3dc372f551 release: v1.6.2 — immersive watching and extensible visualizers
Add synchronized YouTube learning, a plugin-driven visualizer catalog, and Hermes, OpenClaw, and DeepSeek agent harnesses. Refresh Reading, Knowledge, Partner status, guided updates, documentation, translations, and release notes for v1.6.2.
2026-08-31 01:13:07 +08:00
Bingxi Zhao (Frank)
fc0be68d6f wip: course / partner groups in progress 2026-08-29 22:29:53 +08:00
Bingxi Zhao (Frank)
bd80a4d28a release: v1.5.17
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.
2026-08-25 02:24:35 +08:00
Bingxi Zhao
4f06aaa070 fix: isolate Partner data per user (#621)
Keep Partner configuration and assets shared while isolating authenticated users’ sessions, relationship memory, search, and media paths. Preserve legacy admin/IM behavior and enforce assignment checks at every access boundary.
2026-08-16 23:00:41 +08:00
Npaobi
265ff083ce fix: sync partner tool list with global chat tool toggles (#850)
* fix: sync partner tool list with global chat tool toggles

When a user disables a toggleable tool (web_search, brainstorm,
paper_search, reason) in Settings → Chat → Tools, partners
must respect that choice in both the Mind tool picker and at
runtime. Previously the picker showed the full USER_TOGGLEABLE_TOOL_NAMES
pool and defaulted every tool to enabled, and the runtime intersected
only with the partner's own config — so a globally-disabled tool could
still be picked and executed inside a partner.

Changes:
- deeptutor/agents/_shared/tool_composition.py
  Add admin_enabled_optional_tools() that reads the admin's
  interface.json directly (partners run in a synthetic scope, so
  get_enabled_optional_tools() would read the wrong settings file).
  Fails open to the full toggleable set on missing/unreadable file.
- deeptutor/api/utils/tool_options.py
  build_tool_options() now filters the tools list against
  admin_enabled_optional_tools(), so globally-disabled tools do not
  appear in the Mind step picker and are excluded from the default
  'select all' set.
- deeptutor/services/partners/runtime.py
  _resolved_enabled_tools() intersects the partner's configured
  (or defaulted) whitelist with admin_enabled_optional_tools(), so a
  globally-disabled tool can never run inside a partner turn.
- tests/services/partners/test_partner_runtime.py
  Three new tests covering: explicit config intersection, default
  config intersection, and fail-open on missing admin settings.
- tests/api/test_partners_router.py
  New test verifying tool-options endpoint honors global chat toggles.

Closes: Partner tool picker and runtime drift from global chat tool switches

* fix(pre-commit): apply ruff import sorting

* fix: scope optional tool filtering to partner surfaces

---------

Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
2026-08-16 19:21:33 +08:00
Bingxi Zhao (Frank)
712d4137f0 feat: DSML streaming robustness, memory observability, and mastery pending questions
Work in progress carried over from earlier sessions, committed together.

Chat / DSML:
- Tolerate partial and malformed tool-call tags mid-stream, with a character
  ceiling so a stray "<" cannot make the live stream wait forever for its
  closing bracket.
- Narration rounds can now mark their prose as visible, so a DSML round that
  keeps the text surrounding a call has it persisted as part of the answer.

Runtime observability:
- New deeptutor/runtime/memory_probe.py reports resident memory across the
  process tree, exposed at /api/v1/system/memory and surfaced in the settings
  status strip. psutil is a soft dependency, imported lazily with a /proc
  fallback, so a missing wheel costs the strip and not the app.

Mastery:
- New deeptutor/learning/pending.py projects a persisted PendingQuestion into
  the smaller public contract safe to hand the tutor model, and owns the
  multiple-choice translations shared by registration and grading.

LightRAG:
- New pipelines/lightrag/worker.py moves local indexing onto a worker thread's
  own event loop, so RAG-Anything's synchronous graph merging stops stalling
  unrelated API and LLM work.

Also: request-scoped output artifact delivery (api/routers/outputs.py),
partner runtime and path_service adjustments, and CLI chat renderer updates.
2026-08-09 02:31:44 +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)
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)
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