Skip to content

fix(feishu): migrate delivery-trace goldens off the retired capture seam - #110775

Closed
lsr911-code wants to merge 1 commit into
openclaw:mainfrom
lsr911-code:fix/issue-110744-feishu-delivery-trace-seam
Closed

lsr911-code wants to merge 1 commit into
openclaw:mainfrom
lsr911-code:fix/issue-110744-feishu-delivery-trace-seam

Conversation

@lsr911-code

Copy link
Copy Markdown

What Problem This Solves

extensions/feishu/src/delivery-trace.test.ts fails deterministically on unmodified main — all five goldens throw dispatcher options were not captured. Because the checks-node-changed-* dependency graph pulls this shard in, the required openclaw/ci-gate check goes red for any PR that touches the Feishu reply-dispatcher surface (e.g. #110730 hit this on an unrelated diff).

Why This Change Was Made

PR #110095 (refactor(channels): move inbound turn execution into core) changed createFeishuReplyDispatcher to return dispatcherOptions / delivery / replyOptions for core to wire up — it no longer calls createReplyDispatcherWithTyping itself. The same PR migrated the sibling msteams and slack delivery-trace suites off the old capture-seam mock, but missed the feishu suite, whose vi.mock("openclaw/plugin-sdk/reply-runtime") capture never fires anymore.

This completes that migration for feishu, mirroring the exact pattern #110095 applied to extensions/msteams/src/delivery-trace.test.ts: drop the retired capture-seam mock and build the step-driver options directly from the dispatcher's own return value (created.dispatcherOptions + created.delivery.deliver). The feishu plan options already expose onReplyStart / onIdle / onCleanup, so the scenario step wiring is unchanged, and the committed golden traces stay byte-identical — no golden refresh needed.

Changes

  • extensions/feishu/src/delivery-trace.test.ts — remove the retired createReplyDispatcherWithTyping capture-seam mock and the traceState.dispatcherOptions slot; build options from created.dispatcherOptions spread plus created.delivery.deliver, matching the msteams/slack pattern from refactor(channels): move inbound turn execution into core #110095

Evidence

Test command

npx vitest run extensions/feishu/src/delivery-trace.test.ts extensions/msteams/src/delivery-trace.test.ts extensions/slack/src/delivery-trace.test.ts --reporter=verbose

Test output

Before (unmodified main, matching the issue report):

× records streaming-happy 21ms
× records final-only 3ms
× records cancel-mid-stream 2ms
× records rate-limit-during-preview 1ms
× records overflow-pagination 1ms
Error: dispatcher options were not captured
Test Files  1 failed (1)  |  Tests  5 failed (5)

After (this change), including the msteams/slack sibling suites as regressions:

✓ feishu delivery trace goldens > records streaming-happy 62ms
✓ feishu delivery trace goldens > records final-only 7ms
✓ feishu delivery trace goldens > records cancel-mid-stream 6ms
✓ feishu delivery trace goldens > records rate-limit-during-preview 7ms
✓ feishu delivery trace goldens > records overflow-pagination 117ms
✓ msteams delivery trace goldens (4 tests) all passed
✓ slack delivery trace goldens (5 tests) all passed
Test Files  3 passed (3)  |  Tests  14 passed (14)

Behavior

  • Before: the five feishu goldens fail on unmodified main and block ci-gate for any Feishu dispatcher PR
  • After: all five goldens pass against the unchanged committed traces (byte-identical wire recordings — the dispatcher behavior itself was never wrong, only the test seam was stale)

Related

Closes #110744
Follow-up to #110095 (which migrated msteams/slack but missed feishu); unblocks PRs like #110730

AI Assistance Disclosure

Implemented with AI assistance (Claude Code). I reviewed and understand every changed line; the evidence above is real local terminal output (Node 24.15.0, Windows).

PR openclaw#110095 moved inbound turn execution into core and updated the
msteams/slack delivery-trace suites to read dispatcherOptions and
delivery.deliver from the dispatcher's return value, but missed the
feishu suite. Its createReplyDispatcherWithTyping capture mock never
fires now, so all five goldens fail on unmodified main and block the
ci-gate for any PR touching the Feishu reply-dispatcher surface.

Closes openclaw#110744

Co-Authored-By: Claude <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot added channel: feishu Channel integration: feishu size: XS labels Jul 18, 2026
@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. P2 Normal backlog priority with limited blast radius. labels Jul 18, 2026
@clawsweeper

clawsweeper Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 18, 2026, 11:37 AM ET / 15:37 UTC.

Summary
The PR replaces Feishu delivery-trace tests’ obsolete createReplyDispatcherWithTyping capture mock with dispatcher options and delivery returned by createFeishuReplyDispatcher.

PR surface: Tests -12. Total -12 across 1 file.

Reproducibility: yes. from source and supplied terminal evidence: current main retains a mock that waits for a dispatcher call the refactored Feishu factory no longer makes, producing the documented deterministic error across five scenarios.

Review metrics: none identified.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #110744
Summary: This PR is the focused candidate fix for the open canonical report of the retired Feishu delivery-trace capture seam.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Next step before merge

  • [P2] No mechanical follow-up is needed: this is a normal merge review of a focused PR with no actionable defect found.

Security
Cleared: The diff is limited to a TypeScript test harness and removes a mock; it adds no dependency, workflow, credential, permission, or runtime execution surface.

Review details

Best possible solution:

Merge this narrow test-harness migration after normal required checks, allowing the linked Feishu CI-regression report to close through the PR’s existing closing reference.

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

Yes from source and supplied terminal evidence: current main retains a mock that waits for a dispatcher call the refactored Feishu factory no longer makes, producing the documented deterministic error across five scenarios.

Is this the best way to solve the issue?

Yes: using the factory’s returned dispatcher options and delivery function is the narrowest maintainable repair because it follows the already-merged Microsoft Teams and Slack harness contract rather than restoring an obsolete runtime call.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P2: The stale test seam deterministically fails a required Feishu-related CI shard, blocking related pull requests without changing end-user runtime behavior.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides after-fix terminal output for the five affected Feishu golden scenarios and the two sibling suites, with an observed change from deterministic failure to 14 passing tests.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body provides after-fix terminal output for the five affected Feishu golden scenarios and the two sibling suites, with an observed change from deterministic failure to 14 passing tests.

Label justifications:

  • P2: The stale test seam deterministically fails a required Feishu-related CI shard, blocking related pull requests without changing end-user runtime behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body provides after-fix terminal output for the five affected Feishu golden scenarios and the two sibling suites, with an observed change from deterministic failure to 14 passing tests.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides after-fix terminal output for the five affected Feishu golden scenarios and the two sibling suites, with an observed change from deterministic failure to 14 passing tests.
Evidence reviewed

PR surface:

Tests -12. Total -12 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 7 19 -12
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 7 19 -12

What I checked:

  • Changed test seam: The proposed patch removes the test-only openclaw/plugin-sdk/reply-runtime mock and derives the trace driver options from created.dispatcherOptions plus created.delivery.deliver, matching the core-owned inbound-turn contract introduced by the channel refactor. (extensions/feishu/src/delivery-trace.test.ts:366, 0aff5bf49c4f)
  • Merged refactor provenance: The linked merged channel refactor moved inbound turn execution into core and changed bundled channels to return delivery/dispatcher facts for core wiring; its stated follow-up pattern already migrated the Microsoft Teams and Slack delivery-trace suites, establishing the intended test boundary for Feishu. (extensions/msteams/src/delivery-trace.test.ts:472, 601ffa253037)
  • Behavior proof: The PR body supplies before/after terminal output: all five Feishu golden tests fail on current main with dispatcher options were not captured, while the patched Feishu, Microsoft Teams, and Slack suites report 14 passing tests with unchanged committed traces. (extensions/feishu/src/delivery-trace.test.ts:378, 0aff5bf49c4f)
  • Canonical issue relationship: The branch uses closing syntax for the open report describing this same deterministic stale-capture failure, so the issue should remain open until this PR is reviewed and merged rather than being closed preemptively. (extensions/feishu/src/delivery-trace.test.ts:378, 0aff5bf49c4f)

Likely related people:

  • steipete: Authored the merged inbound-turn refactor that established the return-value seam and migrated the equivalent Microsoft Teams and Slack trace suites. (role: merged refactor author; confidence: high; commits: 601ffa253037; files: extensions/feishu/src/delivery-trace.test.ts, extensions/msteams/src/delivery-trace.test.ts, extensions/slack/src/delivery-trace.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

YangManBOBO added a commit to YangManBOBO/openclaw that referenced this pull request Jul 18, 2026
Feishu DM 中意图静默的 NO_REPLY 会经 block 路径跳过,但 onSkip 原先只记录 final,导致误发“无可见内容”兜底。现将 silent 的 block skip 一并纳入状态,并补充直接回调与完整调度管线回归测试。

同时按 openclaw#110775 / openclaw#110095 对 msteams/slack 的同一模式,移除 feishu delivery-trace 中已失效的 createReplyDispatcherWithTyping 捕获缝,改为直接使用 createFeishuReplyDispatcher 返回的 dispatcherOptions/delivery,修复 main 上既有的金标失败并解除 ci-gate 阻塞。

Related: openclaw#109912
Closes: openclaw#110744
@steipete

Copy link
Copy Markdown
Contributor

Thank you for identifying the Feishu delivery-trace fixture left on the retired dispatcher capture seam. The same one-file migration is already fixed and shipped by #110838 (50fdbc5), included in v2026.7.2-beta.4. The canonical test now reads created.dispatcherOptions and uses created.delivery.deliver, covering all five streaming, final, cancellation, rate-limit, and overflow scenarios. The linked issue #110744 is already closed. Closing this overlapping test-only PR as implemented on main; thank you.

@steipete steipete closed this Jul 27, 2026
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. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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.

Feishu delivery-trace golden tests fail: "dispatcher options were not captured" (stale capture-seam mock after #110095)

2 participants