Skip to content

Commit a61c94b

Browse files
clawsweeper[bot]glenn-agentTakhoffman
authored
fix(feishu): wire setup runtime setter (#89814)
Summary: - The PR adds a narrow Feishu runtime-setter entrypoint, wires it into the Feishu setup entry, and adds regression coverage for setup-only runtime registration. - PR surface: Source +7, Tests +22. Total +29 across 4 files. - Reproducibility: yes. source inspection gives a high-confidence reproduction path: current Feishu setup-only ... ate when that setter is present. I did not run a live Feishu tenant message repro in this read-only review. Automerge notes: - PR branch already contained follow-up commit before automerge: fix(feishu): wire setup runtime setter Validation: - ClawSweeper review passed for head befd074. - Required merge gates passed before the squash merge. Prepared head SHA: befd074 Review: #89814 (comment) Co-authored-by: Glenn-Agent <glenn_agent@163.com> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: takhoffman Co-authored-by: takhoffman <781889+takhoffman@users.noreply.github.com>
1 parent a9f099d commit a61c94b

4 files changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Narrow entry point for setFeishuRuntime. Keep setup/runtime registration
2+
// from pulling in the broader Feishu runtime-api barrel.
3+
export { setFeishuRuntime } from "./src/runtime.js";

extensions/feishu/setup-entry.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,16 @@ describe("feishu setup entry", () => {
1717
expect(setupEntry.features).toEqual({ legacyStateMigrations: true });
1818
expect(typeof setupEntry.loadSetupPlugin).toBe("function");
1919
expect(setupEntry.loadLegacyStateMigrationDetector?.()).toBeTypeOf("function");
20+
expect(typeof setupEntry.setChannelRuntime).toBe("function");
21+
});
22+
23+
it("wires the Feishu runtime from setup-only registration", async () => {
24+
const { default: setupEntry } = await import("./setup-entry.js");
25+
const runtime = { channel: { inbound: { run: vi.fn() } } };
26+
27+
setupEntry.setChannelRuntime?.(runtime as never);
28+
29+
const { getFeishuRuntime } = await import("./src/runtime.js");
30+
expect(getFeishuRuntime()).toBe(runtime);
2031
});
2132
});

extensions/feishu/setup-entry.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,8 @@ export default defineBundledChannelSetupEntry({
1717
specifier: "./secret-contract-api.js",
1818
exportName: "channelSecrets",
1919
},
20+
runtime: {
21+
specifier: "./runtime-setter-api.js",
22+
exportName: "setFeishuRuntime",
23+
},
2024
});

src/plugins/contracts/plugin-sdk-runtime-api-guardrails.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,4 +381,15 @@ describe("runtime api guardrails", () => {
381381
'export { setMatrixRuntime } from "./src/runtime.js";',
382382
]);
383383
});
384+
385+
it("keeps Feishu's narrow runtime-setter entrypoint pinned to a single export", () => {
386+
const setterFile = bundledPluginFile({
387+
rootDir: ROOT_DIR,
388+
pluginId: "feishu",
389+
relativePath: "runtime-setter-api.ts",
390+
});
391+
expect(readExportStatements(setterFile)).toEqual([
392+
'export { setFeishuRuntime } from "./src/runtime.js";',
393+
]);
394+
});
384395
});

0 commit comments

Comments
 (0)