62 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)
54324f8318 Merge PR #2674: fix: reject partner session branches that already exist
Preserve both image-only partner history coverage and existing-destination validation tests; combined partner suite: 146 passed.
2026-11-14 22:57:24 +08:00
mpichini1
ca45fb0fc7 fix: retain image-only records in partner session history 2026-11-13 20:08:34 +01:00
mpichini1
44dee85814 fix: reject partner session branches that already exist 2026-11-13 19:26:35 +01:00
Bingxi Zhao (Frank)
823aa1a8b3 Validate launcher, retrieval, migration, and responsive reader behavior 2026-11-06 02:04:53 +08:00
Rudy Celekli
775e548708 fix(partners): slugify partner id when migrating a legacy TutorBot
_migrate_legacy_tutorbot used the raw legacy directory name as the new
partner_id. Every other creation path slugifies the id with
slugify_partner_id, because ids ride in /partners/<id> URLs and must be
ASCII/URL-safe. A legacy bot whose directory name is non-ASCII (e.g. a CJK
name) was therefore migrated under an un-slugged id, leaving it unreachable —
the "Partner not found" symptom in #2166.

Slugify the id, keeping the display name and soul_origin provenance as the
original. Migration stays idempotent across the old layout: an entry already
migrated under either its slug or its raw name is skipped.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-01 09:23:08 -05: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)
9ce7ba9059 fix 2026-10-28 12:28:20 +08:00
Bingxi Zhao (Frank)
fbab59acbf feat: modularize installation and enforce feature dependency boundaries 2026-10-28 01:02:29 +08: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
Bingxi Zhao (Frank)
6bbcc00c55 Merge dev into preview, preserving preview features
Integrate dev fixes with preview's Python/TypeScript schedulers, chat queue, learning navigation, and live turn persistence.
2026-10-27 01:16:58 +08:00
Bingxi Zhao
31e9080ae5 Merge pull request #1846 from dajiaohuang/fix/partner-turn-stop
fix(partners): cancel live web turns when stopping a partner
2026-10-19 00:21:08 +08:00
Bingxi Zhao
06443db9bc Merge pull request #1822 from dajiaohuang/fix/cron-connection-lifetime
fix(storage): close short-lived SQLite connections deterministically
2026-10-19 00:19:44 +08:00
Bingxi Zhao (Frank)
399297e7f0 feat: preserve TypeScript engine migration and workspace updates 2026-10-18 23:09:10 +08:00
dajiaohuang
149343c414 fix(storage): close SQLite connections after helper operations 2026-10-15 12:08:30 +08:00
dajiaohuang
d63a040c1e fix(partners): release turn state after cancellation 2026-10-08 12:35:39 +08:00
dajiaohuang
fd6ccb08ff fix(partners): preserve customized seeded personas 2026-10-08 12:35:39 +08:00
Bingxi Zhao (Frank)
f07029cfcf release: v1.6.13
Ship the reading, listening, question-bank, parsing, and provider updates
summarized in assets/releases/ver1-6-13.md.

Make speech timeouts configurable, report actionable synthesis failures,
and keep chat attachments discoverable in their selected workspace while
preserving earlier uploads and URLs. Keep reply playback cancellation and
single-audio ownership intact.

Sync README prose and all eleven translations, update the stable install
note, and archive release notes older than one week. Repair stale reading
test fixtures and spawned test imports, and clear the Partner type error.

Validation: 9252 Python tests and 8 subtests passed (28 skipped); 518 web
unit tests, 1253 Node tests, and 62 browser audits passed. Pre-commit, ruff,
typecheck, contracts, architecture, i18n, production build, route budgets,
and the docs build passed.
2026-10-04 21:35:00 +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
zhujia
1c1dc61fea fix(partners): merge queued outbound messages before delivery
A partner has one outbound lane and every channel send is a blocking HTTP
round trip, so a fast model filled the queue faster than Feishu could post:
readers kept receiving an answer long after the turn had finished.

- share the dispatcher's delta/progress coalescing with the live router and
  keep message order through a pending queue
- merge queued narration and tool hints, which otherwise cost one API call
  each
- retry ordinary messages with the configured budget, but never hold the lane
  behind backoff sleeps for stream frames, which self-heal
- keep the lane alive when a single message fails, and follow a channel
  reload
- stamp publish time on the bus and warn when delivery waits too long, so a
  trailing reply is visible in the logs
2026-09-30 16:24:51 +08:00
XuanDu
a988f88778 fix: preserve generated partner attachments 2026-09-25 19:35:32 +08:00
Bingxi Zhao (Frank)
0558356d14 Add opt-in cross-browser Partner conversation continuity 2026-09-23 13:34:08 +08:00
Bingxi Zhao (Frank)
8b0ae3891f fix(feishu): keep model picker selectable and avoid callback deadlock 2026-09-23 12:44:11 +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
8b4b712fc0 Merge pull request #1470 from wumajiehechuan-lab/chore/qrcode-core-dependency
chore(deps): 让 qrcode 随核心依赖安装
2026-09-23 10:25:11 +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
wumajiehechuan-lab
2d47b31fe1 docs: align the render_qr_svg docstring with qrcode being a core dependency
The docstring still said qrcode ships with the partners extra — the fact
this PR itself changes. Reword it to match the degradation test's
docstring: a trimmed deployment may still lack it, and missing it must
degrade, not fail.
2026-09-15 07:46:46 -07: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)
7a96bba1ae release: v1.6.6
Ship the v1.6.5 feedback sweep: answers that could not submit now
arrive, a copy button reports what actually happened, partners can use
connected knowledge bases, Codex sign-in finishes inside Docker, and the
home route is 100KB lighter.

Release notes: assets/releases/ver1-6-6.md
2026-09-08 15:46:59 +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)
352f7d1793 fix(partners): refuse turn-owning KB kinds, and finish connected provisioning
#1261 taught `_copy_knowledge_base` that a pointer KB has no folder to copy,
which is right and is what the reported WeKnora case needed. It also made
three kinds assignable that had previously failed for want of a folder, and
left the other half of the feature unbuilt.

Obsidian, MarginNote and subagent KBs are each driven by an *exclusive*
`KnowledgeCapability`: when one is in a turn's KB selection it replaces the
entire tool surface. A partner passes ALL of its knowledge bases as that
selection on every turn, so a single assigned vault would silently seize
every partner turn, and a `subagent` entry with `agent_kind: partner` would
let a partner consult another partner — or itself. They are refused now, by
the set that already names them (`NON_RETRIEVABLE_KB_TYPES`), with a message
that says why instead of a bare FileNotFoundError.

The rest is the half that made a successful assignment look like a failed
one. `list_assets` scanned directories, so a pointer KB was invisible in the
partner's library — and therefore never in `excluded`, so the picker kept
offering it and the user kept assigning it to no visible effect.
`remove_asset` returned False when the folder was missing, which the router
turns into a 404, so it could not be un-assigned either. Both now treat the
folder and the config row as independent, because for a pointer KB only the
row exists.

The two existing connected-KB tests used `obsidian` as their sample, which
this change refuses; they use `weknora` now — the kind actually reported, and
one a partner may legitimately hold.
2026-09-08 00:42:30 +08:00
Bingxi Zhao (Frank)
da285f236b refactor(knowledge): give connected-KB adoption a public entry point
Provisioning reached across modules for `KnowledgeBaseManager.config` and
`_save_config()`, which put a partner-workspace concern inside the manager's
private state. `register_connected_entry` states the operation instead: adopt
an entry that already exists, refuse anything that is not a pointer KB, and
report whether it was new so provisioning stays idempotent the way the
copytree branch is.
2026-09-08 00:00:27 +08:00
Amir Fathi
31c8b104c6 fix(partners): register connected KBs instead of copytree-ing a folder that never exists
_copy_knowledge_base assumed every knowledge base has a data/knowledge_bases/<name>/
folder to copytree. Connected/pointer KBs (Obsidian, linked, ...) are registered in
kb_config.json only and never have such a folder by design, so assigning one to a
Partner always raised FileNotFoundError.

Branch on is_connected_kb() and register the same pointer entry in the partner
scope's own kb_config.json instead of copying.
2026-09-06 06:57:41 +00:00
Bingxi Zhao (Frank)
6e6e56aedb release: v1.6.3
Ship the breaking front- and back-end runtime and route refactor,
learner and guardian flows, grounded reading, knowledge and parser
updates, and recoverable long-running streams.

Release notes: assets/releases/ver1-6-3.md
2026-09-02 04:09:11 +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
evan188199-tech
ec4ee2356a feat(partners): add QR channel onboarding (#952)
Co-authored-by: XZH <cto@xzh.ai>
2026-08-24 16:34:29 +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