_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
_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>
_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>
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.
- 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
* 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>
_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>
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
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
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>
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.
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#1461Fixes#1458Fixes#1451Fixes#1448Fixes#1392Fixes#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>
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.
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.
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.