Files
openclaw/extensions
Yiğit ERDOĞAN 01c6479311 fix(discord): long code-fence replies can exceed the message length limit (#110148)
* fix(discord): reopening a long code fence overflows maxChars

When a chunk is flushed mid code-fence, the next chunk reopens the fence
with the full original opening line (info string included), but the
reserve accounting only budgets the closing marker. A long fence opening
line therefore pushed reopened continuation chunks past maxChars, which
Discord rejects with HTTP 400.

Reopen continuation chunks with a bare marker when the full opening line
would not leave room for the close and body, and size split segments
against the reopen prefix so no chunk exceeds maxChars. This mirrors the
existing closing-fence-overflow guard on the opening/reopen side.

* fix(discord): preserve code after fence reopen

Co-authored-by: Yigtwxx <yigiterdogan023@gmail.com>

* fix(discord): preserve limits when fences cannot fit

Co-authored-by: Yigtwxx <yigiterdogan023@gmail.com>

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-18 23:06:46 +01:00
..