79 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
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
Bingxi Zhao (Frank)
ee6ea9d8c5 Merge #2315 from rudycelekli 2026-11-06 01:56:40 +08:00
Bingxi Zhao (Frank)
920706a55b Merge #2348 from rudycelekli 2026-11-06 01:56:24 +08:00
Rudy Celekli
472e386f58 fix(partners): drop <style>/<script> bodies in email HTML-to-text
_html_to_text stripped only tags, so the CSS/JS inside <style>/<script>
blocks leaked into the plain text fed to the model (and could push the
real message past the body truncation limit). Remove those blocks whole
before the tag strip.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-02 01:12:06 -05: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
RRFZ
8ebb1d31fe style: format the Telegram placeholder test 2026-10-31 21:26:12 -04:00
RRFZ
4838e77387 fix(partners): name only the file when Telegram media fails to send
When a media attachment cannot be sent, the Telegram channel tells the
chat "[Failed to send: <name>]", taking the name with
media_path.rsplit("/", 1)[-1]. A Windows server's path has no "/", so
the chat received the server's full local path instead, exposing the
account name and directory layout to everyone in the chat.

Use Path(media_path).name, as the WeChat channel already does.
2026-10-31 21:25:46 -04: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)
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
5a4159d54c Merge pull request #1852 from dajiaohuang/fix/dingtalk-delivery-retry
fix(channels): propagate failed message deliveries to retry
2026-10-19 00:21:19 +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 (Frank)
399297e7f0 feat: preserve TypeScript engine migration and workspace updates 2026-10-18 23:09:10 +08:00
dajiaohuang
dc7fa7743c test: skip Matrix retry regression without optional SDK 2026-10-08 20:01:20 +08:00
dajiaohuang
af8e89a728 Merge commit '6cf793bd868ba5ecbe64722936d4be8fab5a01df' into fix/dingtalk-delivery-retry 2026-10-08 12:35:41 +08:00
dajiaohuang
f046417500 fix(partners): retain failed channel deliveries for retry 2026-10-08 12:35:41 +08:00
dajiaohuang
7a6f6f507b Merge commit '6cf793bd868ba5ecbe64722936d4be8fab5a01df' into fix/partner-turn-stop 2026-10-08 12:35:39 +08:00
dajiaohuang
e55d7ab780 Merge commit '6cf793bd868ba5ecbe64722936d4be8fab5a01df' into fix/custom-soul-preservation 2026-10-08 12:35:39 +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
evan188199-tech
6be5e6e068 fix(partners): stop telegram typing loop for denied senders and dropped media-group stragglers (#1746)
* test(partners): telegram message parsing, chunking and typing contract suite

Red-first coverage for deeptutor/partners/channels/telegram.py (coverage
gap: 418 missing / 30.2%). 28 green tests pin current behavior; 2 red
tests encode real defects for a fix card:

1. media-group straggler arriving while _flush_media_group dispatches is
   buffered but never flushed (message dropped, buffer leaks)
2. typing indicator for an ACL-denied sender runs forever

No product code changed. Evidence in evidence/telegram-tests-20261003/.

* fix(partners): stop telegram typing loop for denied senders and dropped media-group stragglers

- start the typing indicator only for senders passing is_allowed: a
  denied sender never receives a reply, so the 4-second send_chat_action
  loop used to run until channel restart
- release the media-group task slot before dispatching the buffered
  album, so a straggler item arriving mid-dispatch schedules its own
  follow-up flush instead of being silently dropped (and leaking its
  buffer); the finally guard only drops the task's own registration

* test(partners): telegram suite lint polish; drop internal evidence dir

- fix ruff F541 (redundant f-string) and apply ruff format
- reword red-test docstrings: both defects are fixed on this branch
- remove evidence/telegram-tests-20261003/ (internal tracking artifacts,
  kept on the v1 branch) so the tree matches upstream conventions

---------

Co-authored-by: XZH <cto@xzh.ai>
2026-10-07 20:21:46 +08:00
evan188199-tech
58b3f54c36 test(partners): lock outbound dispatch timeout semantics (#1763)
_dispatch_outbound's 'except asyncio.TimeoutError: continue' is the 1s
idle-poll timeout on an empty outbound queue, not a message skip: a
cancelled Queue.get() pops nothing and a consume finishing despite the
timeout has its result returned by wait_for. Channel send timeouts are
Exception subclasses retried inside _send_with_retry (backoff 1s/2s/4s,
send_max_retries attempts) and logged on give-up. Document this on the
handler and lock it with focused tests (idle poll then deliver, send
timeout retried in-dispatch, retries exhausted after max attempts).

Co-authored-by: XZH <cto@xzh.ai>
2026-10-07 20:12:16 +08:00
Bingxi Zhao
a289eb03f7 Merge pull request #1677 from nextnowlabs/main
fix(partners): keep IM replies in step with the turn
2026-10-04 14:19:16 +08:00
Bingxi Zhao (Frank)
58e4601b52 Merge dev into PR #1687 and preserve integrated behavior 2026-10-04 14:18:47 +08:00
XZH
faac4ec7a3 feat(partners): add Telegram per-chat response policies (#1667) 2026-10-01 17:47:53 -07: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
Hui
7fdadd76cf fix(partners): render every fenced code block as code in Telegram HTML
The Telegram converter protected code with ```[\w]*\n?([\s\S]*?)```,
so an info string such as c++ left "++" as the first code line, a ~~~
block was formatted as prose ("# setup" lost its hash, __init__ became
bold "init"), and a ```` fence showing a ``` example closed at the inner
fence, leaving an empty <pre> and the example leaking out as text.

Replace fenced blocks line by line first: open on ``` or ~~~ and close
on a bare run of the same character that is at least as long. One-line
```code``` and unclosed fences keep the previous regex handling. The
streaming preview strips fences through the same helper.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 21:09:54 -04:00
Bingxi Zhao (Frank)
a5dea06d6f test(partners): exercise copied IMA inside a full turn (#1500) 2026-09-27 10:40:28 +08:00
Bingxi Zhao (Frank)
81bd72d77a test(partners): verify copied IMA retrieval provenance (#1500) 2026-09-27 10:25:47 +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)
13d3e0a683 test(feishu): cover older WebSocket constructor signature 2026-09-23 12:22:06 +08:00
Bingxi Zhao (Frank)
0843e7d518 fix(feishu): dispatch card actions on supported WebSocket SDKs 2026-09-23 12:18:43 +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)
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
wumajiehechuan-lab
c131733b22 chore(deps): install qrcode with the core package
Partner QR onboarding (WeChat, WeCom, Feishu) renders its code server-side,
so `qrcode` is the only thing between an operator and a scannable code. It was
reachable only through the `partners` extra, which means the documented first
step — `pip install -e .` — produces a Channels page whose "Scan to connect"
button silently yields nothing: `render_qr_svg` swallows the ImportError and
returns an empty string, and `_qr_data_url` returns None. Neither the UI nor
the logs say a word, so the failure reads as a broken feature rather than a
missing extra.

The package is pure Python, holds no compiled or system dependencies, and every
scan-based channel needs it, so it belongs in the core set — the same call
already made for `mcp` in issue #792.

- pyproject.toml: move `qrcode` from the `partners` extra into core
- requirements/cli.txt: mirror it, since that file images the core deps
- requirements/partners.txt: drop it; it now arrives via `-r server.txt`
- tests: reword the degradation test, which now guards trimmed deployments
  rather than the default install

The lazy-import fallback itself is kept on purpose: a build assembled without
the full requirement set must still serve a usable page carrying the raw scan
payload.
2026-09-15 01:08:23 -07: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
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