_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>
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.
* 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>
- Guard resource module import in runner server for non-POSIX platforms
- Use POSIX relative path format in ListDirTool for consistent path separators
- Specify UTF-8 encoding in Weixin channel state loading and prompt tests to avoid GBK UnicodeDecodeError
- Use as_posix() in path assertion tests for cross-platform compatibility
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.
Reject newly saved enabled channels with empty allow lists, and safely skip only legacy-invalid channels at startup while preserving deny-by-default behavior and all other Partner services.
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.
#679/#682/#683 each fixed markdown-table cell handling in one channel, but
Slack (convert_markdown_table_to_labeled_rows) and Telegram (_render_table_box)
still split rows with str.strip("|"), which collapses leading/trailing empty
cells and shifts every column — only Feishu (#683) had the correct split.
Extract split_markdown_table_row as the single primitive and route Slack,
Telegram, and Feishu through it: fixes the same class of bug in all three and
removes three near-duplicate row splitters. Slack's separator-row detection now
reuses is_markdown_table_separator_row instead of an ad-hoc regex.
Also fixes the #679 helpers-import ordering and formats the #679/#683 test
files that squash-merge did not run through ruff format.
Blank cells were dropped by a truthiness filter, so columns disappeared from the Slack rendering.
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
When max_len is 0 or negative, the cut pointer never advances and split_message loops forever.
Return the content unsplit, matching the nanobot helpers pattern.
Follow-up to #631/#628: wecom's _chat_frames now uses the same
LRU-bounded OrderedDict idiom as the dedup cache (cap 1000) so
long-running bots can't grow it unboundedly, frame-body extraction is
deduped into one helper, and the dead _loop attribute is gone.
_absolutize_img_paths now skips non-string entries and refuses to
anchor traversal paths ('..' components) with a warning, so a crafted
content_list cannot point the vision stage outside the cache dir.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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>
- 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>