Skip to content

fix(feishu): deliver captioned media with block streaming disabled - #191585

Merged
roboclaw-bot merged 3 commits into
mainfrom
loop/contributor-pr-145487
Nov 3, 2026
Merged

roboclaw-bot merged 3 commits into
mainfrom
loop/contributor-pr-145487

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Supersedes #145487, thanks @forrystudio

What Problem This Solves

Fixes missing captions and attachments in Feishu when completed-block streaming is disabled and a plain captioned media block arrives.

User Impact

Users receive both the caption and attachment without enabling text block streaming. No configuration changes or migration are required.

Why This Change Was Made

Admit media-bearing blocks to the existing caption and native attachment delivery path. Text-only block suppression is preserved. The production change replaces one line, with net zero LOC. This focused replacement leaves existing active-preview settlement behavior unchanged.

Evidence

  • On main 8654e159b99e545d5fd982791bafdcd988432611, both regression cases fail because neither a caption nor an image API request is made. The baseline owner was verified by SHA-256 before the red run.
  • With the fix, 82 tests pass across reply-dispatcher.media.test.ts and reply-dispatcher.test.ts. The new cases use the real dispatcher queue, caption sender, signature routing and image uploader with a mocked Feishu SDK client and media loader. Preview modes off and partial are covered without an active preview or an injected final payload; accepted delivery and fallback suppression are asserted.
  • Crabbox / Blacksmith red-green session: regression-only red run 29.97s; green two-file run 29.22s (30.87s wrapper wall time), with under one second in tests. The runner was stopped after proof. The final typed fixture and export-preserving mock are covered by current-head CI, which passed all checks, including openclaw/ci-gate. The final Bun regression cases took 8 ms and 1 ms.
  • Touched-file type-aware lint, formatting and git diff --check pass. The 89-line test allocation is needed for the requested regression through real senders at the mocked SDK boundary, without production test seams.
  • Autoreview (Codex, P0–P2) reviewed final head cff0f0fb132057f1c1565f1272a8539b7418bd6c against 8654e159b99e545d5fd982791bafdcd988432611, with full dispatcher, client, delivery-result and fixture context: no actionable findings. pr-simplify completed.

Contributor code was read with gh pr view / gh pr diff; the contributor head was never checked out or run. No live Feishu API or inbound/model-loop delivery claim is made.

Admit media-bearing blocks to the existing caption and attachment delivery path while preserving text-only block suppression.

Co-authored-by: forrystudio <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review November 3, 2026 01:28
@openclaw-barnacle openclaw-barnacle Bot added channel: feishu Channel integration: feishu size: S labels Nov 3, 2026
Include the media kind required by WebMediaResult.

Co-authored-by: forrystudio <[email protected]>
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 3, 2026
@clawsweeper

clawsweeper Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Allow captioned media blocks through Feishu delivery when completed-block streaming is disabled.

Example: A block contains “Chart ready” and https://example.com/chart.png with streaming.block.enabled set to false.

  • Before: The non-card block returns without sending either its caption or image.
  • After: The existing senders deliver the caption followed by the native image.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-supported repair with useful boundary coverage; independently inspected evidence does not establish current-head shipped-entry-point behavior.
Proof confidence 🦐 gold shrimp (3/6) This collaborator-authored PR is outside the ordinary contributor proof gate; supplied current-change tests exercise the dispatcher and real senders with mocked external I/O, while the linked source PR records historical real Feishu readback for the shared admission repair.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Feishu users can lose both a plain caption and its attachment when completed-block streaming is disabled.
Reason: The maintainer-authored direction repairs silent delivery loss without adding configuration, state, or a competing delivery path.

Merge readiness

✅ Ready for maintainer review

This PR fixes a current Feishu delivery defect with a focused change to the existing owner; no actionable patch defects were found.

Priority: P2
Reviewed head: 76f416db94ab9487bd108f2abc78fae7d4d298ab

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied current-change coverage uses a mocked Feishu SDK client and does not demonstrate delivery through a running Gateway.
Agent review details

How this fits together

The Feishu reply dispatcher receives queued reply payloads, selects post or card rendering, sends attachments, and returns accepted-delivery receipts to core.

flowchart LR
  A[Reply payload] --> B[Core reply queue]
  B --> C[Feishu dispatcher]
  C --> D[Caption sender]
  D --> E[Media sender]
  E --> F[Feishu API]
  F --> G[Delivery receipt]
Loading

Technical review

Best possible solution:

Retain the one-condition admission repair and existing delivery owners, leaving the broader preview-replacement work separately scoped.

Do we have a high-confidence way to reproduce the issue?

Current-main source deterministically skips a plain captioned media block with completed-block streaming disabled; this read-only review ran no target code.

Is this the best way to solve the issue?

The condition change is the smallest complete repair for the stated admission defect and reuses existing caption, attachment, and partial-delivery accounting.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against abeffef67712.

Provenance checked

  • Feishu non-card block admission keeps the original intent (1572a9e: The changed condition was carried through the presentation-delivery repair to preserve ordinary block policy while allowing independent controls; earlier block-delivery history distinguishes completed-block streaming from ordinary final delivery.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Eden: Raw commit 1572a9e adds extensions/feishu/src/reply-dispatcher.ts:1483 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 1572a9ede1a5; files: extensions/feishu/src/reply-dispatcher.ts)
  • Peter Steinberger: Raw commit c0e2dd7 adds extensions/feishu/src/reply-dispatcher.ts:1266 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c0e2dd79845a; files: extensions/feishu/src/reply-dispatcher.ts)

PR surface

Source 0, Tests +88, Other +2. Total +90 across 3 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 1 88 0 +88
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 3 91 1 +90

Review metrics

Metric Value Why it matters
Production versus regression coverage Production +1/-1 lines; tests +88 lines The coverage exercises real delivery composition and receipts without introducing production seams.

Labels

Label changes:

  • add P2: Caption and attachment loss affects a specific Feishu block-delivery path and has a narrow repair.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Caption and attachment loss affects a specific Feishu block-delivery path and has a narrow repair.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 2, 2026, 8:51 PM ET / November 3, 2026, 01:51 UTC.

Keep the real module exports while overriding client creation at the SDK boundary.

Co-authored-by: forrystudio <[email protected]>
@roboclaw-bot
roboclaw-bot merged commit 569ca48 into main Nov 3, 2026
127 checks passed
@roboclaw-bot
roboclaw-bot deleted the loop/contributor-pr-145487 branch November 3, 2026 02:07
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 3, 2026
…penclaw#191585)

Feishu core delivers attachment blocks even when text block streaming is disabled. Admit captioned media to the existing caption and native attachment delivery path instead of returning before either send.

The 89 additional regression-test lines exercise the real dispatcher queue, caption sender and image uploader through a mocked Feishu SDK client in preview modes off and partial, without an injected final reply or production test seams.

Co-authored-by: forrystudio <[email protected]>
RomneyDa added a commit that referenced this pull request Nov 14, 2026
…191585)

Feishu core delivers attachment blocks even when text block streaming is disabled. Admit captioned media to the existing caption and native attachment delivery path instead of returning before either send.

The 89 additional regression-test lines exercise the real dispatcher queue, caption sender and image uploader through a mocked Feishu SDK client in preview modes off and partial, without an injected final reply or production test seams.

Co-authored-by: forrystudio <[email protected]>
(cherry picked from commit 569ca48)

Release adaptation: inline the existing public-SDK runtime fixture because
reply-dispatcher.test-support.ts is absent on this release baseline. Keep
real dispatcher, caption sender, media classifier and uploader coverage.

Companion audit: later #192469 (monotonic retry window) and #192482
(preview tail deduplication) do not affect captioned non-streaming admission;
not applicable to this fix. #197656 removes obsolete allocation records;
retain the allocation for this release's existing ratchet. No PR-number
follow-ups found through 7bccde6. Existing dispatcher producers, senders
and reply-runtime exports are present-equivalent; no storage changes.

Proof: git diff --check passed. Focused Vitest/typecheck/lint unavailable:
this isolated worktree has no node_modules; no dependencies were installed.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
(cherry picked from commit 52e15d4e681397a7b596b5252688376a9979897d)
RomneyDa added a commit that referenced this pull request Nov 15, 2026
Port Telegram callbacks, hook session keys, private-topic approvals and
interactive widgets with complete send/edit/route security companions.
Include Feishu captioned media, iOS permission Sendable callbacks,
WebKit animation/menu retirement and pending automations props handling.
Keep Matrix malformed formatted-mention parsing linear-time.
Adapt the 11.4 equivalents to the fixed beta baseline where available.

Source PRs: #196217, #191585, #196822, #194027, #197519, #198038,
#196991, #198380, #198658, #184432. Companion scope: #191647, #192162,
#198022, #197271, #194146; #197670 is folded into #197519 equivalent.

(cherry picked from commit 928c118)
(cherry picked from commit 569ca48)
(cherry picked from commit efa744e)
(cherry picked from commit c301da9)
(cherry picked from commit 641c4d5)
(cherry picked from commit b9d3fb4)
(cherry picked from commit a213a51)
(cherry picked from commit ec46689)
(cherry picked from commit 779d22e)
(cherry picked from commit 129ccc3)
(cherry picked from commit 849c050)
(cherry picked from commit b22f35f)
(cherry picked from commit 8b414e9)
(cherry picked from commit 01ecda4)
(cherry picked from commit f978e54)
(cherry picked from commit 6e60479)
(cherry picked from commit ec7b49a)
(cherry picked from commit 1d72ad0)
(cherry picked from commit 5e2c66f)

(cherry picked from commit dfb6454)

Co-authored-by: RomneyDa <[email protected]>

(cherry picked from commit f7c581c7f8bf0e57c7d8799e928a121b24462450)

Co-authored-by: vincentkoc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant