mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 09:41:11 +00:00
style: apply oxformat cleanup
This commit is contained in:
@@ -407,7 +407,9 @@ describe("DiscordVoiceManager", () => {
|
||||
|
||||
await manager.join({ guildId: "g1", channelId: "1001" });
|
||||
|
||||
const entry = (manager as unknown as { sessions: Map<string, unknown> }).sessions.get("g1") as
|
||||
const entry = (manager as unknown as { sessions: Map<string, unknown> }).sessions.get(
|
||||
"g1",
|
||||
) as
|
||||
| {
|
||||
guildId: string;
|
||||
channelId: string;
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
export function resolveMemorySearchPreflight(params: { query: string; hasIndexedContent: boolean }):
|
||||
export function resolveMemorySearchPreflight(params: {
|
||||
query: string;
|
||||
hasIndexedContent: boolean;
|
||||
}):
|
||||
| {
|
||||
normalizedQuery: string;
|
||||
shouldInitializeProvider: boolean;
|
||||
|
||||
@@ -231,29 +231,26 @@ describe("google transport stream", () => {
|
||||
maxTokens: 8192,
|
||||
} satisfies Model<"google-generative-ai">;
|
||||
|
||||
const params = buildGoogleGenerativeAiParams(
|
||||
model,
|
||||
{
|
||||
messages: [
|
||||
{
|
||||
role: "assistant",
|
||||
provider: "openai",
|
||||
api: "openai-responses",
|
||||
model: "gpt-5.4",
|
||||
stopReason: "toolUse",
|
||||
timestamp: 0,
|
||||
content: [
|
||||
{
|
||||
type: "toolCall",
|
||||
id: "call_1",
|
||||
name: "lookup",
|
||||
arguments: "{not valid json",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
} as never,
|
||||
);
|
||||
const params = buildGoogleGenerativeAiParams(model, {
|
||||
messages: [
|
||||
{
|
||||
role: "assistant",
|
||||
provider: "openai",
|
||||
api: "openai-responses",
|
||||
model: "gpt-5.4",
|
||||
stopReason: "toolUse",
|
||||
timestamp: 0,
|
||||
content: [
|
||||
{
|
||||
type: "toolCall",
|
||||
id: "call_1",
|
||||
name: "lookup",
|
||||
arguments: "{not valid json",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
} as never);
|
||||
|
||||
expect(params.contents[0]).toMatchObject({
|
||||
role: "model",
|
||||
|
||||
@@ -60,10 +60,7 @@ export async function resolveAnnounceTarget(params: {
|
||||
(typeof match?.lastAccountId === "string" ? match.lastAccountId : undefined) ??
|
||||
(typeof origin?.accountId === "string" ? origin.accountId : undefined);
|
||||
const threadId = normalizeOptionalStringifiedId(
|
||||
deliveryContext?.threadId ??
|
||||
match?.lastThreadId ??
|
||||
origin?.threadId ??
|
||||
fallbackThreadId,
|
||||
deliveryContext?.threadId ?? match?.lastThreadId ?? origin?.threadId ?? fallbackThreadId,
|
||||
);
|
||||
if (channel && to) {
|
||||
return { channel, to, accountId, threadId };
|
||||
|
||||
@@ -26,14 +26,8 @@ export function sanitizeTransportPayloadText(text: string): string {
|
||||
);
|
||||
}
|
||||
|
||||
export function coerceTransportToolCallArguments(
|
||||
argumentsValue: unknown,
|
||||
): Record<string, unknown> {
|
||||
if (
|
||||
argumentsValue &&
|
||||
typeof argumentsValue === "object" &&
|
||||
!Array.isArray(argumentsValue)
|
||||
) {
|
||||
export function coerceTransportToolCallArguments(argumentsValue: unknown): Record<string, unknown> {
|
||||
if (argumentsValue && typeof argumentsValue === "object" && !Array.isArray(argumentsValue)) {
|
||||
return argumentsValue as Record<string, unknown>;
|
||||
}
|
||||
if (typeof argumentsValue === "string") {
|
||||
|
||||
@@ -1377,9 +1377,9 @@ export function createNestedChannelParsedAllowFromPrompt(params: {
|
||||
getExistingAllowFrom: ({ cfg }: { cfg: OpenClawConfig }) =>
|
||||
params.getExistingAllowFrom?.(cfg) ??
|
||||
(
|
||||
(cfg.channels?.[params.channel] as Record<string, unknown> | undefined)?.[params.section] as
|
||||
| { allowFrom?: Array<string | number> }
|
||||
| undefined
|
||||
(cfg.channels?.[params.channel] as Record<string, unknown> | undefined)?.[
|
||||
params.section
|
||||
] as { allowFrom?: Array<string | number> } | undefined
|
||||
)?.allowFrom ??
|
||||
[],
|
||||
...(params.mergeEntries ? { mergeEntries: params.mergeEntries } : {}),
|
||||
|
||||
@@ -2534,7 +2534,9 @@ describe("gateway server sessions", () => {
|
||||
expect(deleted.ok).toBe(true);
|
||||
expect(deleted.payload?.deleted).toBe(true);
|
||||
expect(subagentLifecycleHookMocks.runSubagentEnded).toHaveBeenCalledTimes(1);
|
||||
const event = (subagentLifecycleHookMocks.runSubagentEnded.mock.calls as unknown[][])[0]?.[0] as
|
||||
const event = (
|
||||
subagentLifecycleHookMocks.runSubagentEnded.mock.calls as unknown[][]
|
||||
)[0]?.[0] as
|
||||
| { targetKind?: string; targetSessionKey?: string; reason?: string; outcome?: string }
|
||||
| undefined;
|
||||
expect(event).toMatchObject({
|
||||
@@ -2850,7 +2852,9 @@ describe("gateway server sessions", () => {
|
||||
expect(reset.payload?.key).toBe("agent:main:subagent:worker");
|
||||
expect(reset.payload?.entry.sessionId).not.toBe("sess-subagent");
|
||||
expect(subagentLifecycleHookMocks.runSubagentEnded).toHaveBeenCalledTimes(1);
|
||||
const event = (subagentLifecycleHookMocks.runSubagentEnded.mock.calls as unknown[][])[0]?.[0] as
|
||||
const event = (
|
||||
subagentLifecycleHookMocks.runSubagentEnded.mock.calls as unknown[][]
|
||||
)[0]?.[0] as
|
||||
| { targetKind?: string; targetSessionKey?: string; reason?: string; outcome?: string }
|
||||
| undefined;
|
||||
expect(event).toMatchObject({
|
||||
|
||||
Reference in New Issue
Block a user