Skip to content

Commit 80655fe

Browse files
committed
test: fix current suite drift
1 parent daa7b1d commit 80655fe

7 files changed

Lines changed: 54 additions & 13 deletions

File tree

extensions/codex/src/app-server/models.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const mocks = vi.hoisted(() => {
66
const authBridge = {
77
applyAuthProfile: vi.fn(async () => undefined),
88
authProfileId: vi.fn((params?: { authProfileId?: string }) => params?.authProfileId),
9+
fallbackApiKeyCacheKey: vi.fn(() => undefined),
910
startOptions: vi.fn(async ({ startOptions }) => startOptions),
1011
};
1112
const managedBinary = {
@@ -20,6 +21,7 @@ const mocks = vi.hoisted(() => {
2021
vi.mock("./auth-bridge.js", () => ({
2122
applyCodexAppServerAuthProfile: mocks.authBridge.applyAuthProfile,
2223
bridgeCodexAppServerStartOptions: mocks.authBridge.startOptions,
24+
resolveCodexAppServerFallbackApiKeyCacheKey: mocks.authBridge.fallbackApiKeyCacheKey,
2325
resolveCodexAppServerAuthProfileIdForAgent: mocks.authBridge.authProfileId,
2426
}));
2527

@@ -50,6 +52,8 @@ describe("listCodexAppServerModels", () => {
5052
mocks.authBridge.authProfileId.mockImplementation(
5153
(params?: { authProfileId?: string }) => params?.authProfileId,
5254
);
55+
mocks.authBridge.fallbackApiKeyCacheKey.mockClear();
56+
mocks.authBridge.fallbackApiKeyCacheKey.mockReturnValue(undefined);
5357
mocks.authBridge.startOptions.mockClear();
5458
mocks.managedBinary.startOptions.mockClear();
5559
mocks.managedBinary.startOptions.mockImplementation(async (startOptions) => startOptions);

extensions/codex/src/app-server/side-question.test.ts

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,13 @@ describe("runCodexAppServerSideQuestion", () => {
712712
getSharedCodexAppServerClientMock.mockResolvedValue(client);
713713

714714
await expect(
715-
runCodexAppServerSideQuestion(sideParams(), { nativeHookRelay: { enabled: true } }),
715+
runCodexAppServerSideQuestion(
716+
sideParams({
717+
cfg: { tools: { loopDetection: { enabled: true } } } as never,
718+
sessionKey: "agent:main:session-1",
719+
}),
720+
{ nativeHookRelay: { enabled: true } },
721+
),
716722
).rejects.toThrow("fork failed");
717723

718724
expect(relayIdDuringFork).toBeDefined();
@@ -738,7 +744,13 @@ describe("runCodexAppServerSideQuestion", () => {
738744
getSharedCodexAppServerClientMock.mockResolvedValue(client);
739745

740746
await expect(
741-
runCodexAppServerSideQuestion(sideParams(), { nativeHookRelay: { enabled: true } }),
747+
runCodexAppServerSideQuestion(
748+
sideParams({
749+
cfg: { tools: { loopDetection: { enabled: true } } } as never,
750+
sessionKey: "agent:main:session-1",
751+
}),
752+
{ nativeHookRelay: { enabled: true } },
753+
),
742754
).resolves.toEqual({ text: "Side answer." });
743755

744756
const forkParams = mockCall(client.request)[1] as Record<string, unknown> | undefined;
@@ -855,15 +867,21 @@ describe("runCodexAppServerSideQuestion", () => {
855867

856868
startedAtMs = Date.now();
857869
await expect(
858-
runCodexAppServerSideQuestion(sideParams(), {
859-
pluginConfig: {
860-
appServer: {
861-
requestTimeoutMs,
862-
turnCompletionIdleTimeoutMs: completionTimeoutMs,
870+
runCodexAppServerSideQuestion(
871+
sideParams({
872+
cfg: { tools: { loopDetection: { enabled: true } } } as never,
873+
sessionKey: "agent:main:session-1",
874+
}),
875+
{
876+
pluginConfig: {
877+
appServer: {
878+
requestTimeoutMs,
879+
turnCompletionIdleTimeoutMs: completionTimeoutMs,
880+
},
863881
},
882+
nativeHookRelay: { enabled: true },
864883
},
865-
nativeHookRelay: { enabled: true },
866-
}),
884+
),
867885
).resolves.toEqual({ text: "Side answer." });
868886

869887
expect(relayIdDuringFork).toBeDefined();

extensions/memory-lancedb/config.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ describe("memory-lancedb config", () => {
7373
expect(manifestResult.ok).toBe(false);
7474
if (!manifestResult.ok) {
7575
expect(manifestResult.errors.map((error) => error.text)).toContain(
76-
"embedding: must NOT have fewer than 1 properties",
76+
"embedding: must not have fewer than 1 properties",
7777
);
7878
}
7979

extensions/telegram/src/bot-native-commands.test-helpers.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ type EnsureConfiguredBindingRouteReadyFn =
2525
typeof import("./bot-native-commands.runtime.js").ensureConfiguredBindingRouteReady;
2626
type GetAgentScopedMediaLocalRootsFn =
2727
typeof import("./bot-native-commands.runtime.js").getAgentScopedMediaLocalRoots;
28+
type ResolveThreadSessionKeysFn =
29+
typeof import("./bot-native-commands.runtime.js").resolveThreadSessionKeys;
2830
type CreateChannelReplyPipelineFn =
2931
typeof import("./bot-native-commands.delivery.runtime.js").createChannelMessageReplyPipeline;
3032
type AnyMock = MockFn<(...args: unknown[]) => unknown>;
@@ -69,6 +71,19 @@ const replyPipelineMocks = vi.hoisted(() => {
6971
ok: true,
7072
})) as unknown as EnsureConfiguredBindingRouteReadyFn),
7173
getAgentScopedMediaLocalRoots: vi.fn<GetAgentScopedMediaLocalRootsFn>(() => []),
74+
resolveThreadSessionKeys: vi.fn<ResolveThreadSessionKeysFn>(
75+
({ baseSessionKey, threadId, parentSessionKey, useSuffix = true, normalizeThreadId }) => {
76+
const normalizedThreadId =
77+
typeof threadId === "string" ? (normalizeThreadId?.(threadId) ?? threadId.trim()) : "";
78+
return {
79+
sessionKey:
80+
normalizedThreadId && useSuffix
81+
? `${baseSessionKey}:thread:${normalizedThreadId.toLowerCase()}`
82+
: baseSessionKey,
83+
parentSessionKey,
84+
};
85+
},
86+
),
7287
};
7388
});
7489
const deliveryMocks = vi.hoisted(() => ({
@@ -84,6 +99,7 @@ vi.mock("./bot-native-commands.runtime.js", () => ({
8499
resolveChunkMode: replyPipelineMocks.resolveChunkMode,
85100
ensureConfiguredBindingRouteReady: replyPipelineMocks.ensureConfiguredBindingRouteReady,
86101
getAgentScopedMediaLocalRoots: replyPipelineMocks.getAgentScopedMediaLocalRoots,
102+
resolveThreadSessionKeys: replyPipelineMocks.resolveThreadSessionKeys,
87103
}));
88104
vi.mock("./bot-native-commands.delivery.runtime.js", () => ({
89105
createChannelMessageReplyPipeline: replyPipelineMocks.createChannelMessageReplyPipeline,

extensions/telegram/src/bot.create-telegram-bot.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2640,7 +2640,7 @@ describe("createTelegramBot", () => {
26402640
message_id: messageId,
26412641
message_thread_id: 99,
26422642
},
2643-
me: { username: "openclaw_bot" },
2643+
me: { username: "openclaw_bot", has_topics_enabled: true },
26442644
getFile: async () => ({ download: async () => new Uint8Array() }),
26452645
});
26462646
};

scripts/ensure-playwright-chromium.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export function resolvePlaywrightInstallRunner(options = {}) {
1313
const env = options.env ?? process.env;
1414
return resolvePnpmRunner({
1515
comSpec: options.comSpec ?? env.ComSpec ?? env.COMSPEC,
16-
npmExecPath: env.npm_execpath,
16+
npmExecPath: env === process.env ? env.npm_execpath : (env.npm_execpath ?? ""),
1717
platform: options.platform,
1818
pnpmArgs: playwrightInstallArgs,
1919
});
@@ -71,7 +71,9 @@ export function ensurePlaywrightChromium(options = {}) {
7171
}
7272

7373
if (!existsSync(executablePath)) {
74-
log(`[ui-e2e] Playwright install completed but Chromium is still missing at ${executablePath}.`);
74+
log(
75+
`[ui-e2e] Playwright install completed but Chromium is still missing at ${executablePath}.`,
76+
);
7577
return 1;
7678
}
7779
return 0;

src/plugins/npm-install-security-scan.release.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const REQUIRED_REVIEWED_PUBLISHABLE_CRITICAL_FINDINGS = new Set([
2929
"@openclaw/codex:dangerous-exec:src/app-server/sandbox-exec-server/processes.ts",
3030
"@openclaw/codex:dangerous-exec:src/app-server/transport-stdio.ts",
3131
"@openclaw/codex:dangerous-exec:src/node-cli-sessions.ts",
32+
"@openclaw/discord:dangerous-exec:src/voice/audio.ts",
3233
"@openclaw/google-meet:dangerous-exec:src/node-host.ts",
3334
"@openclaw/google-meet:dangerous-exec:src/realtime.ts",
3435
"@openclaw/matrix:dangerous-exec:src/matrix/deps.ts",

0 commit comments

Comments
 (0)