Summary
OutboundSender.sendMarkdown and sendText chunk long content and send each chunk as a separate message. Only the first chunk carries opts.replyTo; chunks 2+ are sent as plain new messages, so a long reply that should live inside a thread (e.g. reply_in_thread: true) leaks into the main chat.
Location
channel/outbound/sender.ts:
// sendMarkdown — chunk loop
replyTo: i === 0 ? opts.replyTo : undefined,
// sendText — chunk loop
replyTo: i === 0 ? opts.replyTo : undefined,
Still present in @larksuiteoapi/node-sdk@1.73.0 (latest; lib/index.js lines ~104701 / ~104721).
Expected behavior
Every chunked page should carry replyTo (and replyInThread), so all pages stay in the same thread. Mentions are already correctly limited to the first page via convertMarkdown(chunks[i], i === 0 ? opts.mentions : undefined) — that behavior should be preserved.
Suggested fix
- replyTo: i === 0 ? opts.replyTo : undefined,
+ replyTo: opts.replyTo,
(two occurrences: sendMarkdown and sendText)
Verification
We applied this exact two-line patch in production (patching the bundled copy in a downstream consumer) and confirmed: all chunked pages now arrive inside the thread, first page keeps mentions, no other regressions.
Repro sketch
createLarkChannel({ outbound: { textChunkLimit: <small> } })
- Send a markdown message longer than the chunk limit with
{ replyTo: <msgId>, replyInThread: true }
- Observe: chunk 1 replies to
<msgId>; chunks 2+ are created as top-level messages in the chat.
Summary
OutboundSender.sendMarkdownandsendTextchunk long content and send each chunk as a separate message. Only the first chunk carriesopts.replyTo; chunks 2+ are sent as plain new messages, so a long reply that should live inside a thread (e.g.reply_in_thread: true) leaks into the main chat.Location
channel/outbound/sender.ts:Still present in
@larksuiteoapi/node-sdk@1.73.0(latest; lib/index.js lines ~104701 / ~104721).Expected behavior
Every chunked page should carry
replyTo(andreplyInThread), so all pages stay in the same thread. Mentions are already correctly limited to the first page viaconvertMarkdown(chunks[i], i === 0 ? opts.mentions : undefined)— that behavior should be preserved.Suggested fix
(two occurrences: sendMarkdown and sendText)
Verification
We applied this exact two-line patch in production (patching the bundled copy in a downstream consumer) and confirmed: all chunked pages now arrive inside the thread, first page keeps mentions, no other regressions.
Repro sketch
createLarkChannel({ outbound: { textChunkLimit: <small> } }){ replyTo: <msgId>, replyInThread: true }<msgId>; chunks 2+ are created as top-level messages in the chat.