fix(ci): tighten whatsapp and openai transport types

This commit is contained in:
Vincent Koc 2026-04-04 01:00:45 +09:00
parent f49d8f665c
commit 3d799ba004
2 changed files with 10 additions and 8 deletions

View File

@ -14,6 +14,7 @@ import type { ChannelSetupWizard } from "openclaw/plugin-sdk/setup";
import { formatCliCommand, formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
import { listWhatsAppAccountIds, resolveWhatsAppAccount, resolveWhatsAppAuthDir } from "./accounts.js";
import { loginWeb } from "./login.js";
import type { WhatsAppAccountConfig, WhatsAppConfig } from "./runtime-api.js";
import { whatsappSetupAdapter } from "./setup-core.js";
const channel = "whatsapp" as const;
@ -24,16 +25,16 @@ function mergeWhatsAppConfig(
patch: Partial<NonNullable<NonNullable<OpenClawConfig["channels"]>["whatsapp"]>>,
options?: { unsetOnUndefined?: string[] },
): OpenClawConfig {
const channelConfig = { ...(cfg.channels?.whatsapp ?? {}) } as Record<string, unknown>;
const channelConfig: WhatsAppConfig = { ...(cfg.channels?.whatsapp ?? {}) };
if (accountId === DEFAULT_ACCOUNT_ID) {
for (const [key, value] of Object.entries(patch)) {
if (value === undefined) {
if (options?.unsetOnUndefined?.includes(key)) {
delete channelConfig[key];
delete channelConfig[key as keyof WhatsAppConfig];
}
continue;
}
channelConfig[key] = value;
channelConfig[key as keyof WhatsAppConfig] = value as WhatsAppConfig[keyof WhatsAppConfig];
}
return {
...cfg,
@ -45,17 +46,18 @@ function mergeWhatsAppConfig(
}
const accounts = {
...((channelConfig.accounts as Record<string, Record<string, unknown> | undefined> | undefined) ?? {}),
...(channelConfig.accounts ?? {}),
};
const nextAccount = { ...(accounts[accountId] ?? {}) };
const nextAccount: WhatsAppAccountConfig = { ...(accounts[accountId] ?? {}) };
for (const [key, value] of Object.entries(patch)) {
if (value === undefined) {
if (options?.unsetOnUndefined?.includes(key)) {
delete nextAccount[key];
delete nextAccount[key as keyof WhatsAppAccountConfig];
}
continue;
}
nextAccount[key] = value;
nextAccount[key as keyof WhatsAppAccountConfig] =
value as WhatsAppAccountConfig[keyof WhatsAppAccountConfig];
}
accounts[accountId] = nextAccount;
return {

View File

@ -965,7 +965,7 @@ export function buildOpenAIResponsesParams(
{ supportsDeveloperRole: compat.supportsDeveloperRole },
);
const cacheRetention = resolveCacheRetention(options?.cacheRetention);
const params: Record<string, unknown> = {
const params: ResponseCreateParamsStreaming & Record<string, unknown> = {
model: model.id,
input: messages,
stream: true,