Repository navigation
fix(feishu): expand quoted merged-forward messages - #136231
Conversation
Centralize merged-forward expansion in message retrieval so direct messages, replies, and thread reads share the same parsed content. Signed-off-by: Trae <[email protected]> Co-authored-by: trae-solo-agent <[email protected]> Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 8:09 PM ET / September 7, 2026, 00:09 UTC. ClawSweeper reviewWhat this changesThe Feishu plugin expands forwarded child messages during shared message retrieval so quoted replies receive ordered context, with a visible truncation marker for oversized content. Merge readiness✅ Ready for maintainer review This PR remains necessary: current main and v2026.9.2 still lose quoted merged-forward children. The shared-owner repair and supplied live Feishu evidence support it, and no blocking introduced defect was found. Priority: P1 Review scores
Verification
How this fits togetherFeishu message retrieval supplies quoted messages and thread starters to OpenClaw’s agent context. The plugin converts the service’s container and child records into readable text before agent dispatch. flowchart TD
A[Direct message or quoted reply] --> B[Feishu message retrieval]
B --> C[Feishu API response]
C --> D{Merged forward?}
D -->|Yes| E[Order and bound child text]
D -->|No| F[Ordinary message parsing]
E --> G[Agent context]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +6, Tests +3, Other 0. Total +9 across 8 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep expansion in the shared retrieval owner and remove the duplicate inbound fetch path; the small remaining production growth provides the aggregate context bound and explicit truncation outcome. Do we have a high-confidence way to reproduce the issue? Yes: reply to a Feishu merged-forward message and mention the bot; current main’s getter reads only the container. The supplied real-service trace corroborates the mechanism, although this review did not execute it. Is this the best way to solve the issue? Yes: repairing shared retrieval covers direct inbound, quotes, and thread starters without duplicating parsing in each caller. The separate history-list API remains outside this repair. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against acbff80d68fc. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (9 earlier review cycles; latest 8 shown)
|
|
Evidence update: I independently verified the real Feishu service response under the configured bot identity. The merged-forward GET succeeds and returns one top-level container plus 22 flattened children; a real reply reads back with parent/root/thread IDs. I also narrowed the PR wording to exclude the unchanged thread-list path. The latest live ingress did not inject quoted context, so I have explicitly left the after-fix E2E checkbox open rather than claiming success. @clawsweeper re-review |
|
Correction after controlled candidate testing: the earlier hypothesis that reply metadata was absent from the inbound event context was incorrect. With the stable Feishu WebSocket disabled and head |
Propagate Feishu API and runtime failures so quoted-message retrieval cannot silently degrade to missing context. Signed-off-by: Trae <[email protected]> Co-authored-by: trae-solo-agent <[email protected]> Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
|
Final verification for head
The PR body now contains the complete redacted evidence and corrects the earlier metadata-propagation hypothesis. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Restore the existing message-fetch error contract so this PR only expands merged-forward content. Signed-off-by: Trae <[email protected]> Co-authored-by: trae-solo-agent <[email protected]> Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
|
Scope reduced on head The separate API/runtime error-propagation change has been fully reverted. This PR now only expands flattened merged-forward content through the shared Feishu message-retrieval owner; the existing fetch-error contract is unchanged. Current-head verification:
The prior live Feishu expansion proof remains behavior-equivalent because the reverted commit only changed failure handling. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Exact-head CI follow-up for The only failed job is This is a transient Corepack/Undici download failure, not a Feishu test failure. The contributor account cannot rerun upstream Actions ( |
Cap rendered forwarded context with a UTF-16-safe marker so oversized child bodies cannot exhaust the agent prompt. Signed-off-by: Trae <[email protected]> Co-authored-by: trae-solo-agent <[email protected]> Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
|
Addressed the P0 aggregate-context finding on head
TDD evidence: the added regression failed before the fix with 40,034 code units. It now passes while asserting the aggregate limit, explicit marker, and absence of unpaired surrogates. Current-head focused result is 4 files / 160 tests passed; production and test type checks, extension lint, import-cycle check, full build, and @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Hi maintainers — a brief review ping now that the PR is on exact head |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Related: #136231 Classify only the exact published Trae machine address in native squash composition so machine attribution is excluded without matching human names, other trae.ai addresses, or lookalike domains. Preserve the existing reviewed-body and preview safeguards, with regression coverage for ordinary, case-variant, folded, chosen-body, preview-only, and human-lookalike cases.
|
Merged via squash.
|
…137098 * commit '8a540c252002878f3c3e9d8dfb837b83c8602a78': (2210 commits) perf(plugins): keep bundled catalog lookups lightweight (#140597) refactor: streamline skills JSON serialization (#140581) fix(feishu): expand quoted merged-forward messages (#136231) fix(talk): keep opaque realtime routes out of public config (#129144) fix(ci): avoid Linux packaging on pull requests (#140589) fix(usage): release completed request payloads (#140588) fix(tooling): omit Trae machine squash credit (#140562) fix(ui): stop catalog paging in hidden tabs (#140583) fix(portals): reach IPv6 loopback with IPv4-only localhost records (#140580) fix(transcripts): preserve fixed and legacy capture history (#140563) fix(ui): prevent Talk E2E audio capture stalls (#138803) fix(media): release completed document source buffers (#140561) fix(anthropic): preserve resumed CLI caches across Git changes (#140566) chore(ui): refresh control ui locales (#140586) fix(ui): keep usage exports bound to their session instance (#140573) refactor(exa): test response readers through tool execution (#140572) fix(macos): omit incompatible worker binaries from app bundles (#140557) fix: avoid retaining discarded tool output (#140570) refactor(gateway): share placement move matching (#140569) fix(gateway): preserve child turns during systemd drain (#140568) ... # Conflicts: # .agents/skills/release-openclaw-maintainer/SKILL.md # docs/reference/RELEASING.md
Related: openclaw#136231 Classify only the exact published Trae machine address in native squash composition so machine attribution is excluded without matching human names, other trae.ai addresses, or lookalike domains. Preserve the existing reviewed-body and preview safeguards, with regression coverage for ordinary, case-variant, folded, chosen-body, preview-only, and human-lookalike cases.
Fixes openclaw#136200 Expand Feishu merged-forward children in the shared message retrieval owner so direct inbound messages, quoted replies, and thread starters receive ordered context. Preserve root metadata and existing fetch-failure behavior, while bounding forwarded context to 50 messages and 20,000 UTF-16 code units with an explicit truncation marker. Co-authored-by: Vincent Koc <[email protected]>
Closes #136200
Summary
im.message.getretrieval path.What Problem This Solves
When a Feishu user replies to a merged-forward message, OpenClaw gives the agent only the container placeholder instead of the forwarded child content.
Why This Change Was Made
Feishu returns merged-forward messages as one top-level container plus flattened child items. Message retrieval now selects the container and expands the complete item list before callers build agent context. The parser lives in an independent module so the generated Feishu runtime has an explicit dependency and direct inbound does not keep a second fetch-and-parse path.
The aggregate renderer is UTF-16-safe and bounded so a long forwarded message cannot exhaust the agent prompt. The existing message-fetch failure contract and the separate
listFeishuThreadMessagespath are unchanged.User Impact
Replies to merged-forward messages provide ordered child-message content to the agent instead of only
Merged and Forwarded Message. Oversized forwarded content ends with an explicit truncation marker.Evidence
A controlled live Feishu run made the candidate Gateway the sole WebSocket receiver. A real reply to a newly created merged-forward card logged seven ordered child messages, entered agent dispatch, and produced a streaming Feishu response.
Current exact head
7f89cf6c586dd726d8bbc34ec58493e712b6d16f:getMessageFeishumock had zero calls.check:changed, the full build, andgit diff --checkpassed.Autoreview disposition: the earlier hypothetical rootless child-array concern was not confirmed. The pinned
@larksuiteoapi/node-sdk1.73.0 contract documents merged-forward retrieval as the parent item first withoutupper_message_id, followed by descendants withupper_message_id; the sanitized real payload contained one parent plus 22 children. A rootless child-only array is neither supported by that contract nor observed, so nosend.tsexpansion or hypothetical rootless regression was added.The latest durable ClawSweeper review on the prior exact head rated overall readiness and patch quality 4/6, proof confidence 5/6, and listed
Before merge: None.No rank-up moves were requested. A fresh exact-head re-review will be requested after hosted CI is green.Final diff: 8 files, 208 additions, 199 deletions. Production is 126 additions and 120 deletions (net +6); tests are 81 additions and 78 deletions (net +3); the assertion-safety baseline is +1/-1. The maintainer repair itself is two files, production +1/-1 and tests +7/-13.
No dependency, configuration semantics, or persistent-data behavior changes.
Test plan