Repository navigation
fix(tlon): chunk outbound text over the declared delivery limit - #117438
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 3:00 PM ET / 19:00 UTC. ClawSweeper reviewWhat this changesThe PR makes Tlon’s declared 10,000-character outbound text limit effective by registering the shared Markdown-aware chunker in both the plugin adapter and runtime delegate, with adapter and loopback HTTP-poke coverage. Merge readinessThis PR remains necessary: current main still declares Tlon’s 10,000-character delivery limit without a chunker, so the shared outbound planner sends oversized replies as one unit. The branch supplies the existing Plugin SDK chunker at the correct plugin boundary, has credible loopback transport proof, and has no actionable correctness or security finding; it needs normal maintainer review of the exact merge result. Likely related people: Peter Steinberger is the strongest current-source routing candidate (medium confidence); DaigoSoup is relevant for the analogous merged channel-delivery repair (medium confidence). Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s outbound delivery core converts agent replies into ordered channel send units. Channel plugins declare a delivery limit and chunker; Tlon then delivers each planned unit through its Urbit HTTP poke transport. flowchart LR
A[Agent reply] --> B[Outbound delivery core]
B --> C[Channel adapter settings]
C --> D{Chunker and limit present?}
D -->|yes| E[Bounded Markdown units]
D -->|no| F[One unbounded unit]
E --> G[Tlon HTTP poke transport]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource +8, Tests +184. Total +192 across 4 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Merge this focused plugin-contract repair after GitHub confirms the exact merge result, retaining shared outbound planning as the sole chunking policy rather than adding Tlon-specific HTTP transport splitting. Do we have a high-confidence way to reproduce the issue? Yes. Current main provides a high-confidence source reproduction: Tlon supplies a delivery limit but no chunker, and the shared planner therefore produces one unbounded unit. The PR’s loopback proof shows bounded accepted HTTP pokes after the adapter chunker is applied, although that test manually invokes the chunker rather than calling the delivery core. Is this the best way to solve the issue? Yes. Registering the shared SDK Markdown chunker is the narrowest maintainable fix because the outbound core already owns unit planning and Tlon only needs to declare its channel contract. Splitting inside Tlon’s HTTP sender would duplicate shared policy and risk divergence across delivery routes. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1e9a1405206d. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
|
Maintainer independently ran the identical actual registered Tlon outbound adapter + production outbound planner + real login + real localhost Urbit HTTP poke on freshly pulled current Intentional recipient-visible behavior: one oversized outbound response becomes two ordered, separately visible recipient messages for both direct and group delivery; their concatenated text exactly equals the original response. This replaces the prior total delivery failure; the existing 10,000-character limit is unchanged. Focused owner/transport proof: ClawSweeper rank-up addressed: native maintainer review refreshed current |
|
Merged via squash.
|
…claw#117438) * fix(tlon): chunk outbound text over the declared delivery limit * fix(tlon): guard optional outbound adapter in chunking test * test(tlon): prove chunked outbound over real urbit loopback
What Problem This Solves
Fixes an issue where long Tlon (Urbit) outbound messages could be delivered as a single oversized poke. The channel adapter declared a
textChunkLimitof 10000 but never implemented achunker, so core's delivery planner (src/infra/outbound/message-plan.ts) treated the limit as dead config and sent the whole text in one unit. Messages above the practical platform delivery size are sent unbroken, matching the silent-delivery-failure class that the sibling synology-chat fix (#116645) addressed.Why This Change Was Made
ChannelOutboundAdapter.chunkeris optional. When it is absent,planOutboundTextMessageUnitsreturns the entire text as a singletextunit regardless oftextChunkLimit. Every other bundled channel that declares a limit either provides achunker(zalo, matrix, msteams, signal, telegram, sms, irc, qqbot, feishu, googlechat, imessage, nextcloud-talk, discord, line, twitch, reef, nostr, buzz) or explicitly opts out withchunker: nullplus internal truncation (slack). Tlon was the only adapter declaring a limit with neither. ThetextChunkLimit: 10000has been present since the plugin's original introduction but never wired to an actual chunker.The fix adds the same standard declaration used across sibling channels:
chunkTextForOutboundsplits on newline/space boundaries first and falls back to a hard character split, so bounded sends always succeed.User Impact
Long Tlon messages are now split into bounded chunks at the declared 10000-character limit instead of being delivered as one oversized unit. The
textChunkLimitconfig becomes effective rather than dead.Evidence
extensions/tlon/src/channel.tsandextensions/tlon/src/channel.runtime.tsdeclaredtextChunkLimit: 10000without achunker.src/infra/outbound/deliver-core.ts:130readssendHandler.chunker(typed asChannelOutboundAdapter["chunker"]insrc/infra/outbound/deliver-contracts.ts:62) andplanOutboundTextMessageUnitsreturns the whole text as one unit when the chunker is absent (src/infra/outbound/message-plan.ts:144). Tlon was the only bundled channel declaring a limit with neither a chunker norchunker: null.extensions/tlon/src/channel.outbound.test.tsverifies the gateway adapter declares bounded Markdown chunking (chunkerMode: "markdown",textChunkLimit: 10000) and that the chunker splits a 10001-character string into two bounded chunks.extensions/tlon/src/outbound.loopback.test.tsstarts a mock urbit ship over loopback HTTP (rejects pokes whose memo exceeds 10000 characters with HTTP 413) and sends a 10001-character text through the real adapter path —tlonPlugin.outbound.sendTextauthenticates against the mock ship and issues one poke per chunked unit. The test asserts every poke is accepted (no oversized rejection), each delivered memo stays at or below 10000 characters, the pokes rejoin to the original text, and the poke count equals the chunk count. Full command + result:git diff --check,oxfmt --checkon the changed files, andnode scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.extensions.test.jsonshows no tlon errors.Unexpected prompt: Ship 名称baseline inextensions/tlon/src/core.test.tsunrelated to this change (that file is untouched by this PR).AI Assistance
This PR was prepared with AI-assisted tooling. The author reviewed and understands the changes and their verification limits.