Repository navigation
fix(line): downgrade row-overflow tables to ordered bullet text - #117481
Conversation
|
Codex review: needs changes before merge. Reviewed August 2, 2026, 2:57 AM ET / 06:57 UTC. ClawSweeper reviewWhat this changesThis PR sends Markdown tables exceeding LINE’s 10-row generic or 12-row plain two-column Flex cap as ordered bullet-text segments rather than silently omitting later rows. Merge readinessThe row-overflow fallback addresses a real silent LINE message-loss path and the supplied loopback proof is meaningful, but the final patch duplicates the renderer’s receipt-versus-generic layout decision instead of making it canonical. Keep this PR open for a small mechanical repair so future renderer changes cannot make the pre-check and Flex renderer disagree again. Priority: P1 Review scores
Verification
How this fits togetherThe LINE plugin parses an assistant’s Markdown reply, turning tables into Flex cards when they fit or ordered text segments when they do not. The outbound adapter and inbound auto-reply owner then chunk and send those segments to LINE in source order. flowchart LR
A[Markdown reply] --> B[LINE table formatter]
B --> C{Renderer row layout and cap}
C -->|Fits| D[Flex table card]
C -->|Over cap| E[Ordered bullet-text segments]
D --> F[Outbound and auto-reply delivery]
E --> F
F --> G[LINE API messages]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +8, Tests +572. Total +580 across 4 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Extract renderer-aligned Do we have a high-confidence way to reproduce the issue? Yes. Current main’s generic renderer slices to 10 rows and the plain two-column receipt renderer slices to 12 before Is this the best way to solve the issue? No. Routing row overflow through the existing ordered-segment fallback is the right repair, but duplicating the renderer’s layout decision is not the best durable implementation; one helper should own the classification used by both callers. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 339b9ce0c25e. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What 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 (16 earlier review cycles; latest 8 shown)
|
07588d7 to
018589f
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
df89534 to
4c9b6ae
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
315b5ba to
dca8d27
Compare
dca8d27 to
070c977
Compare
070c977 to
b584ba9
Compare
Add tableRowCap() pre-check before Flex conversion so row-overflow tables route through formatOversizedTableAsBullets() + segments instead of being silently truncated by the renderer's slice(0,10/12). - tableHasInlineMarkup() reuses renderTableCell's canonical hasMarkup - processLineMessage checks row count before convertTableToFlexBubble - convertTableToFlexBubble shares tableHasInlineMarkup for layout decision - Delivery-boundary tests in auto-reply-delivery.test.ts - Runtime artifact tests with LINE SDK provider-facing proof
b584ba9 to
858bcc4
Compare
* origin/main: (99 commits) test: consolidate agent tool suites (openclaw#117886) fix: remove duplicate plugin CLI registry mock (openclaw#117894) fix(gateway): resume shared terminal after slow viewer leaves (openclaw#117847) refactor(gateway): remove deferred channel load flag; 503 plugin routes until runtime ready (openclaw#117852) test(agents): consolidate OpenClaw tool suites (openclaw#117870) fix(ci): repair release validation regressions (openclaw#117723) fix(media): reject empty generated assets (openclaw#117875) fix: release channel delivery resources reliably (openclaw#117855) refactor(cli): unify config-guard policy across dispatch paths (openclaw#117880) test: consolidate WhatsApp monitor suites (openclaw#117854) fix(heartbeat): retain configured account for accountless commitments (openclaw#117521) fix(agents): cap DeepSeek DSML recovery buffer at 256 KB (openclaw#117175) [AI] fix(line): downgrade row-overflow tables to ordered bullet text (openclaw#117481) fix(agents): fallback after replay-safe silent errors (openclaw#117356) fix(telegram): serialize approval ingress sessions (openclaw#117861) fix(agents): report truthful embedded startup stages (openclaw#117879) test(sqlite): align flip-proof request budgets (openclaw#117878) fix(ui): advance gateway-owned channel setup progress (openclaw#117877) fix(media): preserve canonical attachment facts across every agent owner (openclaw#117841) test(protocol): consolidate validation fixtures (openclaw#117873) ...
…penclaw#117481) Add tableRowCap() pre-check before Flex conversion so row-overflow tables route through formatOversizedTableAsBullets() + segments instead of being silently truncated by the renderer's slice(0,10/12). - tableHasInlineMarkup() reuses renderTableCell's canonical hasMarkup - processLineMessage checks row count before convertTableToFlexBubble - convertTableToFlexBubble shares tableHasInlineMarkup for layout decision - Delivery-boundary tests in auto-reply-delivery.test.ts - Runtime artifact tests with LINE SDK provider-facing proof Co-authored-by: Peter Steinberger <[email protected]>
Closes #117442
What Problem This Solves
LINE Flex table renderers silently truncate rows before the existing oversized-table fallback is evaluated, so recipients can receive incomplete tables with no visible indication of data loss.
Two rendering paths both perform lossy row slicing before the 30 KB bubble-size check:
rowCells.slice(0, 10)— rows 11+ dropped silently.items.slice(0, 12)— rows 13+ dropped silently.A 15-row short-content table becomes ~3.6 KB after slicing, passes the oversized check, and is delivered as a plausible but incomplete Flex bubble. The adjacent fix #117335 addressed single-row cell-content overflow but did not cover row-count overflow.
Root Cause
convertTableToFlexBubbleslices data rows to 10 (generic) or passes all rows tocreateReceiptCardwhich slices to 12 (receipt).processLineMessageconverts a table into its Flex bubble before measuring it against the 30,000-byte limit. Row caps therefore make a row-heavy table appear smaller than its complete representation.segmentsfallback contract from fix(line): preserve ordered oversized table delivery #117335, so the ordered bullet-text representation is a shared delivery contract rather than a new path.Canonical Repair
tableHasInlineMarkup(table)that reusesrenderTableCell's canonicalhasMarkupresult to classify table layout — identical decision surface as the renderer itself.tableRowCap(table)usingtableHasInlineMarkup: generic → 10, 2-column without markup → 12, 2-column with markup → 10.table.rowCells.length > tableRowCap(table)BEFORE callingconvertTableToFlexBubblein theprocessLineMessageloop.convertTableToFlexBubblealso callstableHasInlineMarkupinstead of computing hasInlineMarkup inline, eliminating the second approximation and ensuring both code paths share one canonical layout decision.formatOversizedTableAsBullets()+segmentsordered delivery, reusing the established fallback contract.Best-fix judgment: sharing the renderer's exact layout classification is the narrowest safe owner boundary. A second approximation of the markup decision cannot be shown equivalent to the renderer, and a mismatch leaves a silent-truncation gap. The pre-check must consume the same canonical decision as the renderer.
User Impact
LINE recipients now receive complete table data for all tables. A row-overflow table is delivered as ordered bullet text instead of a truncated Flex bubble. Tables within the rendering path caps (≤10 rows generic, ≤12 rows receipt) are unaffected and continue to render as Flex cards.
Evidence
node scripts/run-vitest.mjs extensions/line/src/markdown-to-line.test.ts: 31/31node scripts/run-vitest.mjs extensions/line/src/auto-reply-delivery.test.ts: 32/32 (incl. 4 delivery-boundary proofs)node scripts/run-vitest.mjs extensions/line/src/row-overflow-delivery.loopback.test.ts: 4/4 (loopback HTTP transport proof through production outbound adapter)node scripts/run-vitest.mjs extensions/line/src/send.test.ts: 45/45Unit Regression Tests (markdown-to-line)
<u>literal</u>+<u>real</u>Delivery-Boundary Proof (auto-reply-delivery.test.ts)
Four tests in the "row-overflow table delivery boundary" describe block exercise
deliverLineAutoReplywith realprocessLineMessageproducingsegments, then assert all rows reachreplyMessageLine/pushMessagesLine— the LINE API call boundary:Loopback HTTP Transport Proof — Production Outbound Adapter (row-overflow-delivery.loopback.test.ts)
This test exercises the production outbound adapter (
lineOutboundAdapter.sendPayload) against a loopback LINE HTTP server, following the same pattern as Feishu (dm-delivery-loopback.test.ts), Zalo (channel.target-prefix.integration.test.ts), Tlon (outbound.loopback.test.ts), and Slack (probe.transport.test.ts).The test calls
lineOutboundAdapter.sendPayload({ to, payload: { text }, cfg })which internally invokes the complete production delivery path:processLineMessage→segments.flatMapexpansion (outbound.ts:103-111) →pushMessageLine/pushFlexMessage→sendLineProviderMessages→ real HTTP fetch to LINE API. Anode:httploopback server simulates the LINE Messaging API; a fetch URL-rewrite proxy redirectsapi.line.meto the loopback server. Config-layer dependencies are the only mocks, matching the pattern in other channel loopback tests.Four tests prove complete row delivery through the production outbound adapter and real HTTP transport:
Authorization: Bearerheader present, messages non-emptyAfter-Fix Runtime Artifact (production outbound adapter + loopback transport)
Key Invariant Verified
When
table.rowCells.length > tableRowCap(table),processLineMessageroutes overflow throughformatOversizedTableAsBullets()+segments. The productionlineOutboundAdapter.sendPayloadexpands segments viaflatMapin source order (outbound.ts:103-111). The loopback test exercises the complete production outbound path and proves: every overflow row reaches the real LINE HTTP transport boundary intact and in source order, while an at-cap table is retained as a Flex card. The mixed-table test asserts the wire-level message sequence: Header text → Flex card → overflow text (containing Big1–Big13 + Footer), confirming the production ordered-delivery contract.Diff Shape
AI Assistance