Skip to content

Commit 8ac745d

Browse files
committed
fix(openai): route base64 validation through Plugin SDK media facade
ClawSweeper P1: extensions must cross into core through the documented Plugin SDK boundary, not via direct @openclaw/media-core imports. Switch canonicalizeBase64 back to openclaw/plugin-sdk/media-runtime and mock the barrel in the test (delegating to the real @openclaw/media-core/base64) so collection does not pull in heavy media deps.
1 parent aa6f181 commit 8ac745d

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎extensions/openai/realtime-voice-provider.test.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,13 @@ vi.mock("openclaw/plugin-sdk/provider-auth", () => ({
131131
resolveProviderAuthProfileApiKey: resolveProviderAuthProfileApiKeyMock,
132132
}));
133133

134+
vi.mock("openclaw/plugin-sdk/media-runtime", async () => {
135+
// Route through the lightweight base64 submodule so the test does not pull
136+
// in the full media-runtime barrel (ffmpeg/native deps) at collection time.
137+
const { canonicalizeBase64 } = await import("@openclaw/media-core/base64");
138+
return { canonicalizeBase64 };
139+
});
140+
134141
type FakeWebSocketInstance = InstanceType<typeof FakeWebSocket>;
135142
type SentRealtimeEvent = {
136143
type: string;

‎extensions/openai/realtime-voice-provider.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Openai provider module implements model/runtime integration.
22
import { execFileSync } from "node:child_process";
33
import { randomUUID } from "node:crypto";
4-
import { canonicalizeBase64 } from "@openclaw/media-core/base64";
4+
import { canonicalizeBase64 } from "openclaw/plugin-sdk/media-runtime";
55
import {
66
isProviderAuthProfileConfigured,
77
resolveProviderAuthProfileApiKey,

0 commit comments

Comments
 (0)