openclaw/extensions
Menglin Li 4dc55ea88d
fix(feishu): chunk large documents for write/append to avoid API 400 errors (#14402)
* fix(feishu): chunk large documents for write/append to avoid API 400 errors

The Feishu API limits documentBlockChildren.create to 50 blocks per
request and document.convert has content size limits for large markdown.

Previously, writeDoc and appendDoc would send the entire content in a
single API call, causing HTTP 400 errors for long documents.

This commit adds:
- splitMarkdownByHeadings(): splits markdown at # or ## headings
- chunkedConvertMarkdown(): converts each chunk independently
- chunkedInsertBlocks(): batches blocks into groups of ≤50

Both writeDoc and appendDoc now use the chunked helpers while
preserving backward compatibility for small documents. Image
processing correctly receives all inserted blocks across batches.

* fix(feishu): skip heading detection inside fenced code blocks

Addresses review feedback: splitMarkdownByHeadings() now tracks
fenced code blocks (``` or ~~~) and skips heading-based splitting
when inside one, preventing corruption of code block content.

* Feishu/Docx: add convert fallback chunking + tests

---------

Co-authored-by: lml2468 <lml2468@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
2026-02-27 23:11:12 -06:00
..
acpx chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
bluebubbles chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
copilot-proxy chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
device-pair refactor: de-duplicate channel runtime and payload helpers 2026-02-23 21:25:28 +00:00
diagnostics-otel chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
discord chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
feishu fix(feishu): chunk large documents for write/append to avoid API 400 errors (#14402) 2026-02-27 23:11:12 -06:00
google-gemini-cli-auth chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
googlechat chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
imessage chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
irc chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
line chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
llm-task chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
lobster chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
matrix chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
mattermost chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
memory-core chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
memory-lancedb feat(memory-lancedb): Custom OpenAI BaseURL & Dimensions Support (#17874) 2026-02-27 07:56:09 -08:00
minimax-portal-auth chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
msteams chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
nextcloud-talk chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
nostr chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
open-prose chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
phone-control style: align formatting with oxfmt 0.33 2026-02-18 01:34:35 +00:00
qwen-portal-auth TypeScript: add extensions to tsconfig and fix type errors (#12781) 2026-02-09 10:05:38 -08:00
shared refactor(extensions): dedupe connector helper usage 2026-02-16 14:59:30 +00:00
signal chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
slack chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
synology-chat chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
talk-voice Gateway/Plugins: device pairing + phone control plugins (#11755) 2026-02-08 18:07:13 +01:00
telegram chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
test-utils test: dedupe fixtures and test harness setup 2026-02-23 05:45:54 +00:00
thread-ownership test(extensions): cast fetch mocks to satisfy tsgo 2026-02-16 21:25:35 -05:00
tlon chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
twitch chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
voice-call chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
whatsapp chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00
zalo fix(feishu): replace console.log with runtime log for typing indicator errors (openclaw#18841) thanks @Clawborn 2026-02-27 22:57:16 -06:00
zalouser chore(release): bump 2026.2.27 and split changelog 2026-02-27 16:09:28 +01:00