The flush() helper now enforces the Discord hard limit by hard-splitting
any chunk that exceeds 2000 chars (e.g. when "\n```" was appended after
the soft-limit check). Also reserves 4 chars of overhead in the
soft-limit check when inside a fenced code block.
Adds a regression test that verifies no chunk exceeds 2000 chars even
when the fence closure is appended at the limit boundary.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Resolve conflict in src/router.ts: keep both splitForDiscord (DIS-105)
and sanitizeForDiscord (DIS-102). Apply splitForDiscord to the already
sanitized response text.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add splitForDiscord() in src/discord/split.ts.
Fences are properly closed and reopened across chunk boundaries.
Router uses splitForDiscord instead of internal splitMessage().
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>