Files
openclaw/extensions
ly-wang19 d84a8b1506 fix(discord): reserve closing-fence space on fence-closing lines (#95661)
`chunkDiscordText` reserved closing-fence space from the post-line fence state
(`nextOpenFence`), but a flush during a line's segment loop appends the closing
fence based on the still-open `openFence`, which is only advanced after the
line. On a line that closes a fence yet carries trailing text, `reserveChars`
was 0 while `flush()` still appended a `` ``` ``, producing a chunk of
`maxChars + 4` (e.g. 2004 > 2000) that Discord rejects with HTTP 400.

Reserve against `nextOpenFence ?? openFence` so whichever fence a flush can
close is accounted for, keeping a fence-closing line's chunk within `maxChars`.

Co-authored-by: ly-wang19 <ly-wang19@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 01:28:14 +00:00
..
2026-06-21 12:24:15 +08:00
2026-06-21 12:24:15 +08:00
2026-06-21 12:24:15 +08:00
2026-06-21 12:24:15 +08:00
2026-06-21 12:24:15 +08:00
2026-06-21 12:24:15 +08:00
2026-06-21 12:24:15 +08:00
2026-06-21 12:24:15 +08:00
2026-06-21 12:24:15 +08:00
2026-06-21 12:24:15 +08:00
2026-06-21 12:24:15 +08:00
2026-06-21 12:24:15 +08:00
2026-06-21 12:24:15 +08:00
2026-06-21 12:24:15 +08:00
2026-06-21 12:24:15 +08:00
2026-06-21 12:24:15 +08:00
2026-06-21 12:24:15 +08:00
2026-06-21 12:24:15 +08:00
2026-06-21 12:24:15 +08:00
2026-06-21 12:24:15 +08:00
2026-06-21 12:24:15 +08:00
2026-06-21 12:24:15 +08:00
2026-06-21 12:24:15 +08:00
2026-06-21 12:24:15 +08:00