Repository navigation
fix(channels): preserve long presentation text - #130368
Conversation
Preserve complete authored titles, body text, and context through shared presentation limits and repeated normalization, including whitespace at split boundaries. Keep Discord and Feishu native rendering lossless and retain original content in Discord component-overflow fallback.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 7:24 PM ET / 23:24 UTC. ClawSweeper reviewWhat this changesThis branch splits long Discord and Feishu presentation fields instead of truncating them, preserves fallback text, and routes Feishu native card hooks through its lazy runtime delegates. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessKeep open: current main still truncates presentation text and overwrites Feishu’s native outbound hooks; the branch repairs both paths, with exact-head Gateway proof still pending. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherShared outbound adaptation turns authored presentations into channel-sized fragments before Discord or Feishu render them. The channel plugin then selects native components/cards or a text fallback and sends the resulting message. flowchart LR
A[Authored presentation] --> B[Shared limit adaptation]
B --> C[Channel plugin outbound hooks]
C --> D{Native renderer available?}
D -->|Yes| E[Discord components or Feishu card]
D -->|No| F[Text fallback]
E --> G[Delivered channel message]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource +56, Tests +159. Total +215 across 12 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Keep one shared lossless splitter and the canonical delegate-based Feishu hooks, then merge only after exact-head CI and a Gateway-path Feishu run confirm an interactive card is delivered. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main truncates presentation text and the trailing Feishu delegate spread overwrites both native hooks. I did not execute the regression in this read-only review. Is this the best way to solve the issue? Yes: the branch repairs the shared text owner and configures the existing delegate factory, matching the established sibling pattern instead of adding another delivery path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 25a16dd96c42. LabelsLabel changes:
Label 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
History |
|
@clawsweeper re-review The new head adds a plugin-owned Feishu registration repair uncovered by the full Gateway fixture: the runtime-delegate spread overwrote both native presentation hooks with undefined. Both methods now use the existing factory, with duplicate wrappers removed and public-plugin regressions (2 RED before repair; 332 overlapping targeted tests GREEN afterward). The PR body records the previous exact-head green CI, the genuine old-build Gateway failure, the net -8 production increment, and the pending fresh-build Gateway proof. Please include the new Feishu public-hook path in this review. The prior rebase/rank-up suggestion is addressed in the body; no persisted-state or schema change is involved. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
* origin/main: (26 commits) fix(plugins): preserve registry epoch on activation rollback (#129232) refactor(plugins): make discovery invocation-owned (#130486) feat(ui): save appearance preferences per user profile (#130340) fix: Buzz bots recover relay stalls and reject revoked senders (#130467) fix(code-mode): serialize catalog handles nested in final values (#130276) fix(webchat): CLI skill and harness-injected turns render as operator-sent messages (#130427) fix(agents): read the published model catalog owner from session_status (#130277) fix(channels): preserve long presentation text (#130368) fix(agents): route CLI bootstrap truncation notice into the system prompt (#130325) refactor(plugins): unify setup registration and artifact selection (#130474) fix(memory): prevent forgotten session content from returning (#130451) refactor(outbound): consolidate transport completion (#130460) fix(workers): protect in-flight workspace manifests from concurrent retention (#130449) fix(portals): keep worker previews reachable and owned by the active environment (#130434) fix(config): keep core channels keys in the generated config schema (#120736) chore(deps): refresh dependencies after seven-day cooldown (#130296) fix(agents): remind exec models to quote shell metacharacters (#125485) fix(auth): honor shared-store ownership in temp-state exec and agent deletion (#130437) fix(openshell): preserve file writes during concurrent mirror commands (#130447) fix(workers): report full nodes as at capacity, not offline (#130445) ...
* fix(channels): preserve long presentation text Preserve complete authored titles, body text, and context through shared presentation limits and repeated normalization, including whitespace at split boundaries. Keep Discord and Feishu native rendering lossless and retain original content in Discord component-overflow fallback. * test(channels): fix presentation regression CI gates * fix(feishu): retain native presentation outbound hooks
What Problem This Solves
Fixes an issue where users sending long rich messages would silently lose the end of their title, body, or context text when a channel applied presentation limits. Discord shortened each authored field to 1,997 characters and Feishu to 4,000, even though the message was otherwise accepted. Discord's fallback for presentations exceeding its component envelope could also omit shortened text and action labels. Full-Gateway testing additionally exposed that Feishu's advertised native-card hooks were overwritten during plugin registration, sending text fallback instead of native cards.
Why This Change Was Made
The invariant is that channel adaptation must preserve the full authored text, in order, including meaningful whitespace at split boundaries. The shared presentation owner already split generated chart, table, and action fallback text, but separately truncated authored title/body/context. This change uses that existing splitter for all presentation text and deletes the destructive text adapter. Title overflow becomes ordered body continuations.
Splitting alone was insufficient: Feishu normalized the adapted fragments again, and Discord trimmed each rendered fragment. Canonical normalization now retains the existing private continuation metadata and split-boundary whitespace while keeping ordinary raw-input trimming unchanged. Discord preserves fragment text and uses the original presentation when it falls back to plain text.
Feishu defined
renderPresentationandsendPayloadbefore spreading runtime delegates configured only for text/media. The helper returns own undefined properties for unconfigured hooks, so that spread erased both native methods. The plugin now configures both through the existing delegate factory and deletes its handwritten wrappers; the shared helper's semantics are unchanged. The regression tests enter through Feishu's public plugin barrel, which the earlier internal-renderer tests did not cover.Transport caps, configuration, exported API contracts, and native action budgets are unchanged. Production LOC is +77/-63 (net +14); tests and test support are +338/-137 (net +201). The Feishu registration repair contributes +5/-13 (net -8) production lines and 60 test lines. The test totals also include moving existing chart/table action cases and their shared setup into focused files; the earlier CI repair added 22 net lines of test organization and no production code. Remaining production growth belongs to canonical normalization preserving split-continuation text, not a parallel delivery path.
User Impact
Long Discord and Feishu presentations retain complete titles, body text, context, and fallback action labels. Spaces, newlines, indentation, and Unicode characters survive splitting and repeated normalization. Channels without a shared text-length cap retain their existing behavior.
Release-note context: preserve long channel presentation text instead of silently truncating it, including Discord and Feishu rendering and Discord component-overflow fallback; restore Feishu native-card rendering and payload delivery through its public plugin registration.
Evidence
AI-assisted implementation with maintainer-directed scope and independent review.
Before the production change, the owner regressions failed in four cases, and the native Discord and Feishu regressions each failed in all three authored-field cases. After the fix, 417 distinct tests passed: owner/payload 87, Discord 117, Feishu 139, LINE 8, Telegram 31, and Slack 35.
The boundary tests reconstruct the entire authored string across a space/newline/indentation split. Discord uses the real component builder and serializer; Feishu verifies the real rendered card handed to the sender. Shared tests cover Unicode code-point, UTF-8-byte, and UTF-16-unit limits, repeated adaptation/normalization, context downgrade, and uncapped behavior. Discord's oversized-table regression checks complete authored text and an untruncated action label in plain fallback.
The original type-only corrections were rerun: 87 owner/payload tests and all three new Discord cases passed. Independent source review found no actionable defects; the configured Codex review passed its P0 gate with no findings.
Ready-event CI run 33010497418 completed with two introduced test-only failures: the Unicode assertion used ES2024
String.isWellFormedunder the repository's ES2023 declarations, and the expanded Discord action test file exceeded its unchanged 1,000-line cap. All selected runtime test jobs, build artifacts, production types, and channel/plugin boundary checks passed. Commit0dcad8208462617fc85bdabeb655a48459427527replaces the assertion with equivalent UTF-8 Buffer round-trip equality and splits the existing chart/table action tests using shared test support. No compiler settings, lint caps, or assertions were weakened.After that repair, 132 focused tests passed (87 owner/payload and 45 Discord action tests, including adjacent upload/adopted-thread suites); this rerun is not added to the 417-test coverage count. Formatting,
git diff --check, scoped core lint, and syntax-only extension lint with the unchanged repository rules passed. The fresh configured Codex P0 review and independent review of the test-only diff were clean. CI run 33012557087 subsequently passed every selected gate on0dcad8208462617fc85bdabeb655a48459427527, including types, lint, builds, and runtime tests. That result predates the Feishu hook repair and is not claimed as its CI proof.Additional native HTTP proof passed: the real Feishu adapter, card renderer, sender, and Lark SDK performed a loopback token exchange and four authenticated local message POSTs for title, text, context, and combined cases. Exact received card text preserved split whitespace and all 12,089 characters in the combined case. Only the SDK's public HTTP interceptor redirected the configured loopback origin; the adapter, renderer, and sender were not mocked. The actual Vitest result was
{"numTotalTests":1,"numPassedTests":1,"numFailedTests":0,"success":true}. Its SHA-256 is9c79e4946022ea5b5bb07dec181b01887d5e108044b113ebd3c981df98a591f6; the received-wire capture SHA-256 is9b9aeffd5340d24c96dd246edfaab18af3f9116b86bb32324275e1c0935de15a.Validation limitations: the local install's Google enum, markdown-it, and Pi TUI dependency mismatches still block canonical typechecking and full extension lint declaration preparation. Extension test typechecking also reports dependency mismatches in unrelated plugins; no changed-file diagnostics remain. These local broad gates are not claimed green.
The full ephemeral Gateway + mock provider + native Feishu API flow then ran against CI build
6eef1ac78ddc5267c0e04a0fce8107615eb50cd1(PR-head parentcd057142b3ccecacb6a57275169450136abcc77a). Actual HTTP chat ingress, agent execution, message-tool invocation, Feishu startup/authentication, and platform HTTP delivery all occurred. The native-card assertion correctly failed: the receiver gotposttext messages rather than aninteractivecard. Inspecting the compiled public plugin confirmed that both native hooks were undefined. This is genuine failing Gateway evidence, not a successful verdict.History traces the overwrite to e582cebf2d4c (May 9, 2026), when the runtime helper gained these optional hook properties. Feishu's native hooks had been added in #72667; its trailing delegate spread predates them. The repair is plugin-owned because Matrix/MSTeams already configure native hooks through the helper, Slack overrides its relevant methods afterward, and Tlon has no native presentation hooks.
The two new public-hook regressions both failed before the registration repair and passed afterward. 332 targeted tests passed across four Feishu suites (public outbound wrapper 2, channel 189, outbound 139, presentation card 2); these overlap the earlier suites and are not added to the 417-test count. They preserve exact context/result forwarding and native error propagation. The incremental configured Codex P0 review and independent review were clean. Scoped syntax lint, formatting, guards, dead-export checks, and five doctor-contract tests passed; the broader changed gate stopped on local dependency type errors outside the changed files. Commit
d50b177b4605c5ec42c38c091451d498ea065aaecontains only the Feishu registration fix and its public-wrapper regressions.The full compiled Gateway rerun passed on the new head. CI run 33022725998 produced
dist-runtime-buildartifact9627291614, built from merge commit8965a8e4495f0756eec7e04d5bc6a413dae89dbawith parents395e5db41b5c3f14cbb40114daa801135d2e6fdeand reviewed PR headd50b177b4605c5ec42c38c091451d498ea065aae. Exact merge-commit manifests/templates were verified by Git blob SHA; no source overlay or compiled-JS patch was used. The test launched the unmodified compiled Gateway, actual registered Feishu plugin, native renderer/sender and Lark SDK, with the existing scripted mock provider and an isolated loopback native API.Three real
/v1/chat/completionsingress calls produced six mock-provider requests, three nativeinteractivecard POSTs, and three model-visiblesentreceipts with matching platform IDs and one result per payload. Complete received title (4,029 characters), text (4,027), and context (4,033) matched the authored strings exactly, including boundary whitespace. This is mock-Gateway/native-API proof, not an authenticated live-platform send or visual screenshot.Actual verdict from
ci-gateway-fixed-33022725998-result.json:{"numTotalTests":1,"numPassedTests":1,"numFailedTests":0,"success":true}Frozen SHA-256 evidence: verdict
19972115fde868d0046d26e36b602aa864dca82857dbba550450729d1c6221c0; received wirecc9a74bc142667902f2faddb6989fe1765b4da94392defeca89769ae597ed19a; extracted actual tool receiptsaf265f01b69f9a52c7f722ce108a1d60c403166286224331c5b85bf3e255a182; CI archivec48caaf928e2fd683cbbe499f29e03f37ab3773b6f2e5571b8285f1d393f5f37. Gateway/provider servers shut down and fixture state was cleaned. The earlier failed compiled build remains historical RED evidence.Independent source-blind validation of the frozen wire, agent-result, and receipt captures passed all three behavior-contract clauses with no findings: three native cards, exact full authored text, and matching successful receipts/completions. It did not inspect source or witness the run. HTTP statuses/native response bodies are absent from those exported captures; the actual fixture separately asserted HTTP 200. Authenticated platform acceptance and visual application rendering remain outside this artifact-only validation.
Proof limits and named follow-up: outbound transcript mirroring logged
session reboundwarnings after successful native delivery; the old pre-repair Gateway run shows the same warning. This proof validates channel delivery and model-visible receipts, not transcript mirroring. Investigate the isolated cross-channel target/session lifecycle separately; this diagnostic is not yet classified as a product defect. No live-channel or clean-install proof is claimed. Exact-head CI run 33022725998 completed successfully, includingopenclaw/ci-gate; the compiled Gateway delivery verdict also passed.Review follow-up: the latest exact-head ClawSweeper review found no actionable source defect and endorsed the single shared splitter and canonical Feishu delegates; both rank-up items are fulfilled by exact-head green CI and the passing Gateway native-card result above. Its live-command transcript passed both new tests twice; the reported partial failure was the review harness expecting a suite-title string absent from Vitest's normal output, not a failed test. Maintainer inspection of current main found no changes to the shared presentation/helper owners and no overlapping Feishu outbound-registration change; unrelated Feishu action/sticker updates are included in the new CI merge-ref build and passed compiled Gateway proof. Rebase is intentionally skipped absent a conflict or stale-code risk, preserving the reviewed stack. Test serialization assertions do not change persisted state or schemas, so no migration is involved.