Skip to content

Commit 0aff5bf

Browse files
lsr911-codeclaude
andcommitted
fix(feishu): migrate delivery-trace goldens off the retired capture seam
PR #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 #110744 Co-Authored-By: Claude <[email protected]>
1 parent faf3dbd commit 0aff5bf

1 file changed

Lines changed: 7 additions & 19 deletions

File tree

‎extensions/feishu/src/delivery-trace.test.ts‎

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// Feishu delivery trace goldens: replayable wire-level lifecycle recordings.
22
//
3-
// IN events are fed straight into the reply-dispatcher wiring (the options
4-
// createReplyDispatcherWithTyping receives plus replyOptions callbacks); OUT
3+
// IN events are fed straight into the reply-dispatcher wiring (the core-owned
4+
// dispatcher options and delivery returned by createFeishuReplyDispatcher plus
5+
// replyOptions callbacks); OUT
56
// events are recorded at the mocked Lark SDK client and the mocked CardKit
67
// HTTP fetch, so streaming-card entity calls are captured at the wire seam.
78
// Refresh goldens with OPENCLAW_TRACE_UPDATE=1 (see delivery-trace harness docs).
@@ -37,7 +38,6 @@ type FeishuTraceState = {
3738
account: ResolvedFeishuAccount | null;
3839
larkClient: unknown;
3940
cardKitFetch: typeof fetch | null;
40-
dispatcherOptions: FeishuDispatcherOptions | null;
4141
messageCount: number;
4242
reactionCount: number;
4343
cardCount: number;
@@ -51,7 +51,6 @@ const traceState = vi.hoisted(
5151
account: null,
5252
larkClient: null,
5353
cardKitFetch: null,
54-
dispatcherOptions: null,
5554
messageCount: 0,
5655
reactionCount: 0,
5756
cardCount: 0,
@@ -88,17 +87,6 @@ vi.mock("./client.js", async (importOriginal) => {
8887
};
8988
});
9089

91-
vi.mock("openclaw/plugin-sdk/reply-runtime", async (importOriginal) => {
92-
const actual = await importOriginal<Record<string, unknown>>();
93-
return {
94-
...actual,
95-
createReplyDispatcherWithTyping: (options: FeishuDispatcherOptions) => {
96-
traceState.dispatcherOptions = options;
97-
return { dispatcher: {}, replyOptions: {}, markDispatchIdle: () => {} };
98-
},
99-
};
100-
});
101-
10290
// Module-scoped runtime stub (not the shared global runtime slot) so
10391
// isolate=false workers never leak this stub into other feishu test files.
10492
// channel.text uses the real chunking/table helpers because overflow
@@ -378,10 +366,10 @@ function setupFeishuTrace(recorder: WireRecorder, scenario: DeliveryTraceScenari
378366
sendTarget: "oc-trace-chat",
379367
replyToMessageId: "om-inbound",
380368
});
381-
const options = traceState.dispatcherOptions;
382-
if (!options) {
383-
throw new Error("dispatcher options were not captured");
384-
}
369+
const options = {
370+
...created.dispatcherOptions,
371+
deliver: created.delivery.deliver,
372+
} as FeishuDispatcherOptions;
385373

386374
return async (step: DeliveryTraceInStep) => {
387375
switch (step.kind) {

0 commit comments

Comments
 (0)