Skip to content

fix(feishu): preserve canonical outbound delivery lifecycle - #117223

Merged
steipete merged 1 commit into
mainfrom
codex/qa400-feishu-canonical-delivery-lifecycle
Aug 1, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa400-feishu-canonical-delivery-lifecycle

Conversation

@steipete

@steipete steipete commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

  • Refactor the private Feishu outbound owner around one canonical per-provider-delivery lifecycle.
  • Prevent duplicate text-only media sends, persist every accepted expanded text or attachment before later fallible work, and retain explicit reply targets across provider-generated chunks.
  • Preserve implicit one-shot replies, sticky topics, degraded voice, visible attachment fallbacks, and existing public plugin/configuration contracts.

Why This Change Was Made

One private outbound owner is responsible for all three reproduced root causes: duplicated text-only media requests, accepted provider chunks lost before later work fails, and explicitly chosen reply targets lost during provider-expanded Markdown fanout. A bounded refactor establishes one canonical per-platform-delivery path instead of adding independent special-case repairs. The existing Feishu-only production owner grows by 12 lines; no plugin SDK, public config, dependency, authentication, protocol, database schema, or other channel changes.

User Impact

Feishu operators see one text-only message instead of two, retain durable evidence for every accepted text/attachment before a later failure or retry, and keep explicit replies anchored through every expanded chunk. Existing implicit first-only replies, native topic roots, visible upload-failure fallback, degraded voice, original attachment behavior, and account isolation remain intact.

Evidence

  • Exact reviewed head: 67abd59475a3a2c1b8fa2a1bda26c8ce17694117; tree: 761f4925dbe80b3c90111684d9515015cf902f0d; current main: 4fb19fb8c586b2d7801d1c512a4ac21e4d826505; clean synthetic merge tree: c0510bf04d85a27731420a0855a7d8a8a7881f9a.
  • Blacksmith hosted production and extension-test TypeScript gates, targeted type-aware lint, formatting, and git diff --check: passed.
  • Complete Feishu suite excluding one independently confirmed unrelated baseline-red doctor file: 92 files, 1,429 tests passed.
  • Actual installed @larksuiteoapi/[email protected] with real localhost HTTP/auth/upload/message requests: 13/13 scenarios passed, including accepted-chunk persistence, later provider HTTP 400, receipt persistence failure, explicit/implicit replies, topic threads, upload fallback, and degraded voice.
  • Four independent blind P0–P3 reviews and full immutable-branch autoreview: clean.
  • One dedicated hosted lease completed and was stopped: tbx_01kyxs681x92k629djyy15fjmw.

extensions/feishu/src/doctor.test.ts already fails identically on both this change's frozen base b521ce626bfb479ba39e7919445c76e40d1d21aa and the actually tested then-current main 618f3298c7dc00a41549e4dec41d8412f651624b; every relevant doctor/session-owner path remains byte-identical on current main 4fb19fb8c586b2d7801d1c512a4ac21e4d826505. Its existing test helper attempts to write agent:codex:acp:binding:feishu:default:abc123 into the agent:main SQLite session store, which the unchanged canonical owner rejects with SESSION_CANONICAL_KEY_MIGRATION_REQUIRED; the other 12 tests in that existing file pass. This PR changes neither the doctor nor session-owner paths.

@openclaw-barnacle openclaw-barnacle Bot added channel: feishu Channel integration: feishu size: L maintainer Maintainer-authored PR labels Aug 1, 2026
@steipete
steipete marked this pull request as ready for review August 1, 2026 05:05
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P1 High-priority user-facing bug, regression, or broken workflow. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 1:47 AM ET / 05:47 UTC.

ClawSweeper review

What this changes

The PR refactors Feishu outbound text, media, card, and fallback sends so each accepted platform delivery reports through the canonical callback, reply targets survive chunk fanout, and a persistence failure does not trigger a duplicate fallback send.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

The patch is still necessary: current main has the preceding Feishu reply-target work but not this canonical delivery-reporting lifecycle. Direct code review finds no blocking defect, and the supplied real HTTP proof plus the now-successful exact-head checks support a maintainer merge decision; the maintainer label keeps it out of automated cleanup.

Priority: P1
Reviewed head: 67abd59475a3a2c1b8fa2a1bda26c8ce17694117
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong behavior evidence and focused owner-boundary coverage support a normal mergeable-quality rating, pending the protected human owner review.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body documents after-fix installed-SDK localhost HTTP/auth/upload/message scenarios across all claimed delivery paths, and the supplied exact-head Real behavior proof checks succeeded; redact any private endpoints or credentials if the evidence is reposted.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body documents after-fix installed-SDK localhost HTTP/auth/upload/message scenarios across all claimed delivery paths, and the supplied exact-head Real behavior proof checks succeeded; redact any private endpoints or credentials if the evidence is reposted.
Evidence reviewed 6 items Canonical delivery callback is added at the Feishu owner boundary: The proposed helper awaits the channel-attached delivery callback, and the text delivery loop reports each provider-accepted chunk before moving to the next chunk.
Plugin SDK contract matches per-delivery reporting: The reply payload dispatcher marks a child send as reported when its callback runs and otherwise records the returned result, so reporting inside Feishu prevents an accepted expanded chunk from being deferred until the final result.
Preceding Feishu owner history: Current-main history shows commit b521ce626bfb479ba39e7919445c76e40d1d21aa, fix(feishu): consume implicit reply targets across media delivery (#117196), immediately preceding this PR's broader delivery-lifecycle repair.
Findings None None.
Security None None.

How this fits together

Feishu receives reply payloads from the plugin SDK and turns them into text, media, card, or comment sends. Each accepted platform send reports a delivery result back to the reply pipeline, which records progress before later chunks or fallible steps continue.

flowchart LR
  A[Agent reply payload] --> B[Feishu outbound adapter]
  B --> C[Reply target fanout]
  C --> D[Text media card or comment delivery]
  D --> E[Delivery result callback]
  E --> F[Reply progress and session record]
Loading

Decision needed

Question Recommendation
Should the Feishu owner accept this owner-boundary lifecycle refactor after reviewing the current clean merge result? Approve the canonical lifecycle: Merge after confirming the clean three-way result preserves the tested callback ordering and Feishu-specific reply semantics.

Why: The patch changes the channel's delivery-recording order and reply-target propagation; source and proof support it, but the protected maintainer label reserves final acceptance for an explicit human owner decision.

Before merge

  • Complete next step (P2) - No mechanical repair remains; explicit Feishu-owner approval is required because this protected maintainer-labeled PR changes canonical outbound delivery ordering.
Agent review details

Security

None.

PR surface

Source +12, Tests +254. Total +266 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 138 126 +12
Tests 1 254 0 +254
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 392 126 +266

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: extensions/feishu/src/outbound.test.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Retain one owner-local Feishu delivery lifecycle and have a Feishu owner confirm the current clean merge result before landing this exact tested head.

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

Yes—source establishes that current Feishu sends can return a final result without per-accepted-delivery callback reporting, and the PR body supplies real localhost SDK scenarios for the affected text, media, and fanout paths.

Is this the best way to solve the issue?

Yes—the refactor repairs the Feishu outbound owner where accepted sends, reply fanout, and delivery callbacks meet, rather than adding downstream persistence or retry exceptions.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 6922ddd93610.

Labels

Label justifications:

  • P1: The patch addresses duplicate Feishu sends, missing accepted-delivery progress, and misapplied reply targets in an active channel workflow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body documents after-fix installed-SDK localhost HTTP/auth/upload/message scenarios across all claimed delivery paths, and the supplied exact-head Real behavior proof checks succeeded; redact any private endpoints or credentials if the evidence is reposted.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body documents after-fix installed-SDK localhost HTTP/auth/upload/message scenarios across all claimed delivery paths, and the supplied exact-head Real behavior proof checks succeeded; redact any private endpoints or credentials if the evidence is reposted.

Evidence

What I checked:

  • Canonical delivery callback is added at the Feishu owner boundary: The proposed helper awaits the channel-attached delivery callback, and the text delivery loop reports each provider-accepted chunk before moving to the next chunk. (extensions/feishu/src/outbound.ts:395, 67abd59475a3)
  • Plugin SDK contract matches per-delivery reporting: The reply payload dispatcher marks a child send as reported when its callback runs and otherwise records the returned result, so reporting inside Feishu prevents an accepted expanded chunk from being deferred until the final result. (src/plugin-sdk/reply-payload.ts:436, 6922ddd93610)
  • Preceding Feishu owner history: Current-main history shows commit b521ce626bfb479ba39e7919445c76e40d1d21aa, fix(feishu): consume implicit reply targets across media delivery (#117196), immediately preceding this PR's broader delivery-lifecycle repair. (extensions/feishu/src/outbound.ts:386, b521ce626bfb)
  • Current main does not already contain this PR: The PR base is an ancestor of current main, while the current-main-to-PR comparison still contains the full two-file lifecycle refactor; this remains an open, useful change rather than an implemented-on-main cleanup candidate. (extensions/feishu/src/outbound.ts:771, 6922ddd93610)
  • Exact-head validation and real behavior proof: The supplied PR evidence reports 13/13 installed Lark SDK localhost HTTP/auth/upload/message scenarios and 1,429 focused Feishu tests; the provided check state shows build artifacts, channel-runtime-boundary, Real behavior proof, CI gate, lint, production types, and security checks successful on the reviewed head. (extensions/feishu/src/outbound.test.ts:572, 67abd59475a3)
  • Release provenance: The latest shipped release v2026.7.1 points to 2d2ddc43d0dcf71f31283d780f9fe9ff4cc04fe4 and predates current main; the unmerged PR head is not contained in a release tag. (2d2ddc43d0dc)

Likely related people:

  • steipete: Authored the immediately preceding current-main Feishu reply-target repair and the current lifecycle refactor; history concentrates recent changes to this outbound owner under this contributor. (role: recent Feishu delivery owner; confidence: high; commits: b521ce626bfb, 67abd59475a3; files: extensions/feishu/src/outbound.ts, extensions/feishu/src/outbound.test.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-01T05:11:11.760Z sha 67abd59 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit ad3e36e into main Aug 1, 2026
157 of 167 checks passed
@steipete
steipete deleted the codex/qa400-feishu-canonical-delivery-lifecycle branch August 1, 2026 06:16
@steipete

steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 1, 2026
vincentkoc added a commit to a-tokyo/openclaw that referenced this pull request Aug 1, 2026
…in-4caff51-20260801

* origin/main:
  fix(agents): surface /new guidance for thinking-signature replay errors (openclaw#116967) (openclaw#116987)
  fix(doctor): keep repaired session rows readable (openclaw#117207)
  fix(feishu): unify outbound delivery lifecycle (openclaw#117223)
  docs(gateway): document llamacpp toolSchemaProfile for custom llama.cpp endpoints (openclaw#117120)
  fix(clickclack): thread replies stop being answered past the 100-reply thread window (openclaw#117225)
  fix(talk): retain bounded relay close owners
  fix(talk): bound relay transcript persistence
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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