mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-25 03:45:46 -06:00
960b050add
* refactor(memory-core): remove orphaned shadow trials * refactor(qqbot): migrate direct voice upload formats Release note: QQBot configs using voiceDirectUploadFormats now migrate through openclaw doctor --fix to audioFormatPolicy.uploadDirectFormats at root and account scope. Existing nested uploadDirectFormats values win conflicts, and runtime reads only the nested policy. * refactor(feishu): migrate tools base alias Release note: Feishu configs using tools.base now migrate through openclaw doctor --fix to tools.bitable at root and account scope. Existing bitable values win conflicts, and runtime accepts only the canonical key. * refactor(extensions): remove dead runtime state * chore(config): refresh bundled channel metadata * refactor(codex): keep realtime fallback type private * test(ci): align QA compatibility scenario count
55 lines
1.5 KiB
TypeScript
55 lines
1.5 KiB
TypeScript
import { afterEach, describe, expect, it } from "vitest";
|
|
import { configureCodexRealtimeBrowserSession } from "./realtime-voice-api.js";
|
|
|
|
const leases: Array<ReturnType<typeof configureCodexRealtimeBrowserSession>> = [];
|
|
|
|
const createRuntime = () => {
|
|
const runtime = configureCodexRealtimeBrowserSession({
|
|
getConfig: () => undefined,
|
|
getPluginConfig: () => undefined,
|
|
});
|
|
leases.push(runtime);
|
|
return runtime;
|
|
};
|
|
|
|
describe("Codex realtime voice runtime artifact", () => {
|
|
afterEach(async () => {
|
|
await Promise.all(leases.splice(0).map((runtime) => runtime.cleanup()));
|
|
});
|
|
|
|
it("shares one owner runtime across registration leases", async () => {
|
|
const first = createRuntime();
|
|
const second = createRuntime();
|
|
|
|
expect(second).not.toBe(first);
|
|
expect(second.broker).toBe(first.broker);
|
|
|
|
await first.cleanup();
|
|
await second.cleanup();
|
|
});
|
|
|
|
it("reads config from the newest active registration", () => {
|
|
let firstConfigReads = 0;
|
|
let secondConfigReads = 0;
|
|
const first = configureCodexRealtimeBrowserSession({
|
|
getConfig: () => {
|
|
firstConfigReads += 1;
|
|
return undefined;
|
|
},
|
|
getPluginConfig: () => undefined,
|
|
});
|
|
const second = configureCodexRealtimeBrowserSession({
|
|
getConfig: () => {
|
|
secondConfigReads += 1;
|
|
return undefined;
|
|
},
|
|
getPluginConfig: () => undefined,
|
|
});
|
|
leases.push(first, second);
|
|
|
|
expect(second.broker.isConfigured()).toBe(false);
|
|
expect(firstConfigReads).toBe(0);
|
|
expect(secondConfigReads).toBe(1);
|
|
});
|
|
});
|