Repository navigation
fix(line): give up a card LINE will refuse instead of losing the reply - #135229
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 9:15 PM ET / September 2, 2026, 01:15 UTC. ClawSweeper reviewWhat this changesThe PR rejects generated LINE Flex cards whose serialized UTF-8 JSON exceeds LINE’s per-bubble limit, allowing the existing text fallback to deliver the reply and control labels. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessNo blocking correctness finding in this focused LINE delivery repair. Keep this PR open for normal maintainer review; the local partial clone could not hydrate the latest main blobs, so exact-current-main equivalence remains a reviewer limitation rather than a contributor defect. Priority: P1 Review scores
Verification
How this fits togetherThe LINE plugin converts agent reply presentations into native Flex cards or fallback text before sending them through LINE’s outbound transport. This change adds the platform-size decision at the generated-card boundary so an oversized card does not cause the entire reply to be rejected. flowchart LR
A[Agent reply presentation] --> B[LINE presentation renderer]
B --> C{Bubble within 30 KB?}
C -->|Yes| D[Native Flex card]
C -->|No| E[Text fallback]
D --> F[LINE outbound delivery]
E --> F
F --> G[LINE Messaging API]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +3, Tests +48. Total +51 across 4 files. View PR surface stats
Review metrics
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:
Technical reviewBest possible solution: Land one shared UTF-8 bubble-size predicate at the LINE renderer boundary so oversized generated cards consistently use the established content-preserving text fallback. Do we have a high-confidence way to reproduce the issue? Yes, at source level: a presentation with buttons and a generated bubble over 30,000 serialized UTF-8 bytes reaches the pre-fix native-card path, while the related report records LINE’s rejection. This review did not rerun that external request. Is this the best way to solve the issue? Yes. Rejecting the generated card at its renderer boundary lets both existing fallback owners preserve the whole reply; transport-time recovery would occur after a rejected native request, and truncation would lose content. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against df2530204103. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Share the existing UTF-8 bubble-size predicate between tables and generated cards. Select the full text fallback before LINE rejects an oversized card while preserving quick-reply prompt and overflow handling. Refs openclaw#135229, openclaw#135228. Co-authored-by: xuyuanhao <[email protected]>
|
Merged via squash.
|
openclaw#135229) Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: xuyuanhao <[email protected]>
What Problem This Solves
Generated LINE cards larger than LINE's 30 KB serialized bubble limit can reject the entire reply. The existing text fallback is never selected when the renderer returns an oversized native card.
Why This Change Was Made
The LINE card renderer now uses the same UTF-8 JSON byte predicate as Markdown table conversion. An oversized generated card returns null so the existing presentation fallback preserves the answer, title and control labels. The shared 30 KB bubble and 50 KB carousel constants introduced for custom-card normalization remain intact.
Production is +10/-7 (net +3); tests are +48. The three added production lines carry one platform-cap contract at the native renderer boundary after removing duplicate byte-limit ownership. No config, dependency, storage, schema or public API changes are introduced. ClawSweeper's serialized-state heuristic does not apply to these transient outgoing HTTP payloads; there is no persisted data migration.
User Impact
Cards within the limit remain native. Oversized cards become chunked text containing the full reply and control labels. Existing Markdown tables and custom-card normalization preserve their behavior.
Evidence
The independently authored candidate was tested on canonical main
d225e672bd216d87be6098e732e7acff4c7c7cd3. The pre-fix owner produced two expected overflow failures with twenty-seven controls passing. The fixed rich-message and Markdown-table suites passed 82 tests, including the independently landed quick-reply HTTP delivery matrix; the full build and all changed-file gates completed with exit 0. Fresh candidate autoreview found no P0 issue. The completed Testbox run is https://github.com/openclaw/openclaw/actions/runs/33567661996.An actual built ephemeral Gateway drove the production LINE path against a synthetic LINE HTTP API and mock provider. A signed webhook/model reply control passed. A generated card of exactly 30,000 bytes stayed native; 30,001-byte and UTF-8 30,002-byte cards became seven and three accepted text messages respectively, with answer/title/control content preserved. Temporary Gateway state was removed. This is real application-flow proof with mocked external services, not an authenticated LINE service run.
{"passed":true,"cases":[{"bubbleBytes":30000,"nativeFlex":true,"acceptedRequests":2},{"bubbleBytes":30001,"nativeFlex":false,"textMessages":7},{"bubbleBytes":30002,"utf8":true,"nativeFlex":false,"textMessages":3}],"answerAndControlContentPreserved":true,"gatewayTemporaryStateRemoved":true}This candidate preserves the quick-reply prompt and overflow implementation independently merged by #134976 in canonical main
d225e672bd216d87be6098e732e7acff4c7c7cd3. Native integration and exact-head CI are tracked separately; this recorded execution is bound to the stated baseline and frozen candidate hashes.The platform size contract was checked directly in LINE's Messaging API reference. This addresses the review's missing primary-contract lookup; the production diff is reduced from +15 to +3 without changing the intended fallback behavior.
Closes #135228. Original contribution by @edenfunf.