A DingTalk AI card replays streamed content with a typewriter animation the
client drives itself, so a finished answer can still be typed out character
by character - and a card that is not in the foreground pauses that replay.
DINGTALK_CARD_FINAL_WRITE now sequences the two terminal writes explicitly:
streaming (default) streaming finalize only (unchanged)
update finalize, then a plain write (observed to blank the card)
refresh plain write of the finished answer, then a zero-delta
finalize carrying the same text
close-refresh zero-delta finalize on the text the card already shows,
then a plain write of the finished answer
The sender remembers the text each live card shows so a terminal write can
close the stream with a frame the client has nothing to animate; a failing
plain write is logged and never fails the delivery.
Streamed card content is replayed by the DingTalk client with a typewriter
animation it drives itself, so an answer that is already complete on the server
can still be typed out - and a client that leaves the foreground pauses that
animation, which reads as 'streaming stopped, it continues when I switch back'
long after the final frame was pushed.
Add DINGTALK_CARD_FINAL_WRITE (streaming default | update): in update mode the
streaming finalize is followed by one plain PUT /v1.0/card/instances write with
the identical template variables, so the terminal content has no typewriter
queue behind it. The follow-up write never fails a delivered answer.
DINGTALK_CARD_PARTIAL_UPDATES selects how much of an answer is written into
the card while it is still being produced:
partial (default, unset) - placeholder card plus throttled partial answer
and progress frames, then the final update
final - placeholder card, no partial frames at all; the
finished answer lands in the single final update
direct - no placeholder card; one card with the answer
Both non-default modes drop the 500ms redraw pump for the turn, so the card
only ever shows content that is actually final. handleNonStreaming and the
two new modes share one delivery helper, and the markdown fallback keeps the
existing behaviour when the card cannot be delivered.
A table that starts forming made stableMarkdownPrefix truncate every
streaming frame at the table start, so the card froze and the whole table
plus tail arrived in the single finalize frame (live: 5.2 KB dump after the
answer had already finished upstream).
Add the DINGTALK_CARD_WIDE_TABLE_GROUP=smooth mode: over-wide tables are
grouped on every frame (as "on") and, while streaming, every table is
grouped so no table block survives into a partial frame. The final frame
keeps the real table whenever it lays out safely.
The DingTalk binding can point at the quick-answer agent, which publishes the
whole answer as one answer run plus tool_call/tool_result steps. The narration
boundary was rejected for that shape (start=0), so the text-only heuristic ran
and dropped the answer lead-in together with its image.
- answer_observation: a single answer run means there is no narration to cut.
- outboundtext: rewrite LaTeX formulas into plain Unicode text, because
DingTalk cards render no math typesetting (r = sqrt(X^2 + Y^2) -> r = √(X² + Y²)).
- dingtalk handler: normalize formulas on both the partial and final card paths.
DINGTALK_CARD_WIDE_TABLE_GROUP=off keeps over-wide answer tables as tables on the final frame (still replaces <br> inside cells) so the PC wide-screen card can lay them out itself.
- outboundimage: re-encode large PNG/JPEG screenshots as downscaled JPEG (1600px long edge, q82, transparency flattened onto white) before upload; undecodable, small, GIF/WebP payloads are published untouched
- outboundimage: StableHashPublisher skips the upload when the content-addressed object already exists (ObjectStater); OSS store implements it via IsObjectExist
- cmd/dobotai: DOBOTAI_OUTBOUND_IMAGE_REWRITE_TIMEOUT default 60s -> 180s; DOBOTAI_OUTBOUND_IMAGE_COMPRESS (on by default, off restores raw bytes)
- outboundimage: fetch and publish up to 4 images in parallel, dedupe in document order, log per-image outcome plus a rewrite summary
- dingtalk handler: OutboundRewriteTimeout applies to the image rewrite stage only, falling back to finalDeliveryTimeout
- cmd/dobotai: DOBOTAI_OUTBOUND_IMAGE_REWRITE_TIMEOUT (default 60s, invalid values fall back)
AI card bodies render only DingTalk-hosted media, so published image URLs are
rewritten into media ids inside card content (streaming frames never block,
final frame waits briefly), while the markdown fallback keeps external URLs.