Repository navigation
fix(irc): preserve code in replies across message boundaries - #138328
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 4, 2026, 10:45 AM ET / 14:45 UTC. ClawSweeper reviewWhat this changesThe PR renders each complete IRC reply to plain text before chunking it, adds local TCP regressions for code and links across boundaries, and documents IRC outbound text behavior. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep this maintainer-authored PR open: current main still chunks raw Markdown before the IRC sender renders it, while this patch moves rendering to the sender boundary and preserves existing reply and receipt flow. No blocking correctness or security finding was identified. Priority: P1 Review scores
Verification
How this fits togetherThe IRC plugin receives formatted agent output through OpenClaw’s channel delivery layer, turns it into IRC-safe plain text, and sends chunked messages with reply references and delivery receipts. This change moves the Markdown-to-text transformation ahead of that chunk planning step. flowchart LR
A[Formatted agent reply] --> B[IRC outbound adapter]
B --> C[Complete plain-text rendering]
C --> D[Chunk planning and reply fanout]
D --> E[IRC client]
E --> F[IRC messages and receipts]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -25, Tests +107, Docs +14. Total +96 across 4 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep complete-message Markdown projection owned by the IRC sender, then plan IRC-sized plain-text chunks while retaining the existing reply fanout, connection, and receipt behavior. Do we have a high-confidence way to reproduce the issue? Yes — source inspection of current main shows raw Markdown is split before the sender projects it to plain text, and the supplied PR evidence records matching before/after local TCP scenarios. No local test was rerun because this review requires a read-only checkout. Is this the best way to solve the issue? Yes — rendering at AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 523221e3767f. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
sylvesterkaczmarek
left a comment
There was a problem hiding this comment.
Rendering the complete logical reply before chunking is the correct ownership order. Splitting raw Markdown first guarantees boundary-dependent parser behaviour, especially around fences and inline code, while the plain-text chunker already owns IRC frame planning. The local TCP proof that every resulting frame stays within the 512-byte IRC limit is the key compatibility check here. This also removes the risky “empty rendered chunk” recovery path instead of adding another fence special case.
|
Merged via squash.
|
…9-prep * commit '407a8f453c0f0306af1ddc0aafa8697c1d49a9e7': (312 commits) perf(ui): coalesce automation event refreshes (#138065) fix: reject incomplete Skill Workshop directory reads (#138082) test(ui): decouple rendering checks from generated wording (#138283) perf: avoid temporary entries in bounded JSON traversal (#138017) fix(irc): render complete messages before splitting (#138328) perf: prepare worker trajectory payloads only for recorded events (#138086) fix(mcp): paginated listings no longer time out after a forward clock step (#137206) fix(codex): page native transcripts and bound UI previews (#136282) feat(gateway): apply more settings without restarting (#138112) fix(docs): preserve mirrored ClawHub maturity links (#138241) fix(test): own UI animation and legacy database setup (#138296) fix(tts): preserve literal directives in Markdown code (#138319) fix: load chat widgets behind authenticated gateways (#138074) chore(ui): cover native approval finalization (#137259) fix(cron): cancel conditions before main-session handoff (#138313) fix(backup): preserve text after embedded NUL characters (#138327) fix(android): align composer control sheets (#137442) fix(ci): wait for replacement PR runs instead of stale failures (#138307) fix(sessions): keep Gateway responsive with long transcripts (#138094) fix(computer): map window inputs to delivered image coordinates (#138271) ... # Conflicts: # scripts/release-check.ts # test/release-check.test.ts
Additional instructions
Maintainers can update this branch through normal repository access.
What Problem This Solves
Fixes an issue where long IRC replies lost literal formatting characters inside code. If a chunk contained only a closing code fence, the entire nonempty reply could fail before sending anything.
Why This Change Was Made
The IRC sender now renders the complete logical message into plain text before splitting it. It owns one canonical preparation step, then the existing plain-text chunker plans the physical messages. This deletes duplicate raw-Markdown length/newline splitting, empty-chunk fallback paths and an unused private target override.
Production +29/−54, net −25; regression tests +107; docs +14. Direct and formatted sends retain account limits, reply scope, one transient connection per batch, cancellation/readiness checks, wire sanitization and receipts. Configuration, storage, protocol, dependencies and security policy are unchanged.
User Impact
Code literals and link destinations survive message boundaries, and a closing fence cannot make an otherwise valid reply disappear. IRC documentation describes the plain-text behavior and a normal CLI send.
Evidence
plugins.load.pathsinto the same trusted packaged core. Before, the long-code reply returns success after losing literal asterisks; the fence-boundary reply fails with zero sends. After, both and a recovery reply succeed, preserve the text, return normal results/receipts, stay within512-byte IRC frames, and use exactly one connection and clean disconnect per batch. All task-owned listeners and children close.The packaged proof uses the exact candidate plugin on shared core
a7da4314609485e5296de0f5e8a56486122706dd, with rendering/chunking/socket owner identities verified against current source. It is not an exact-main full package build. Earlier direct-source attempts stalled while materializing the broad plugin runtime; diagnostics falsified a suspected delivery-callback stall. Those controller-limited attempts remain recorded, and no callback, runtime check or timeout was bypassed. Existing current-source cancellation controls pass separately.Release-note context: render IRC replies before splitting so long code examples retain literal characters and fence-only fragments cannot reject the reply.