diff --git a/extensions/bluebubbles/src/monitor.test.ts b/extensions/bluebubbles/src/monitor.test.ts index 73fabd4a4b3..64649f52acd 100644 --- a/extensions/bluebubbles/src/monitor.test.ts +++ b/extensions/bluebubbles/src/monitor.test.ts @@ -8,6 +8,8 @@ import { } from "../../../test/helpers/extensions/bluebubbles-monitor.js"; import type { ResolvedBlueBubblesAccount } from "./accounts.js"; import { fetchBlueBubblesHistory } from "./history.js"; +import { createBlueBubblesDebounceRegistry } from "./monitor-debounce.js"; +import type { NormalizedWebhookMessage } from "./monitor-normalize.js"; import { resetBlueBubblesSelfChatCache } from "./monitor-self-chat-cache.js"; import { handleBlueBubblesWebhookRequest, resolveBlueBubblesMessageId } from "./monitor.js"; import { @@ -27,8 +29,6 @@ import { resetBlueBubblesParticipantContactNameCacheForTest, setBlueBubblesParticipantContactDepsForTest, } from "./participant-contact-names.js"; -import { createBlueBubblesDebounceRegistry } from "./monitor-debounce.js"; -import type { NormalizedWebhookMessage } from "./monitor-normalize.js"; import type { OpenClawConfig, PluginRuntime } from "./runtime-api.js"; // Mock dependencies @@ -155,7 +155,10 @@ function installTimingAwareInboundDebouncer(core: PluginRuntime) { core.channel.debounce.createInboundDebouncer = vi.fn((params: any) => { // oxlint-disable-next-line typescript/no-explicit-any type Item = any; - const buckets = new Map | null }>(); + const buckets = new Map< + string, + { items: Item[]; timer: ReturnType | null } + >(); const flush = async (key: string) => { const bucket = buckets.get(key); diff --git a/extensions/google/provider-models.test.ts b/extensions/google/provider-models.test.ts index 7ef5ffd3c2b..4ceb7dee02f 100644 --- a/extensions/google/provider-models.test.ts +++ b/extensions/google/provider-models.test.ts @@ -1,9 +1,9 @@ import type { ModelRegistry } from "@mariozechner/pi-coding-agent"; -import { describe, expect, it } from "vitest"; import type { ProviderResolveDynamicModelContext, ProviderRuntimeModel, } from "openclaw/plugin-sdk/plugin-entry"; +import { describe, expect, it } from "vitest"; import { resolveGoogle31ForwardCompatModel } from "./provider-models.js"; function createTemplateModel( diff --git a/extensions/google/provider-models.ts b/extensions/google/provider-models.ts index 8c64a753950..16c4b31e2c7 100644 --- a/extensions/google/provider-models.ts +++ b/extensions/google/provider-models.ts @@ -8,9 +8,7 @@ const GEMINI_3_1_PRO_PREFIX = "gemini-3.1-pro"; const GEMINI_3_1_FLASH_LITE_PREFIX = "gemini-3.1-flash-lite"; const GEMINI_3_1_FLASH_PREFIX = "gemini-3.1-flash"; const GEMINI_3_1_PRO_TEMPLATE_IDS = ["gemini-3-pro-preview"] as const; -const GEMINI_3_1_FLASH_LITE_TEMPLATE_IDS = [ - "gemini-3.1-flash-lite-preview", -] as const; +const GEMINI_3_1_FLASH_LITE_TEMPLATE_IDS = ["gemini-3.1-flash-lite-preview"] as const; const GEMINI_3_1_FLASH_TEMPLATE_IDS = ["gemini-3-flash-preview"] as const; function cloneFirstGoogleTemplateModel(params: { @@ -21,10 +19,7 @@ function cloneFirstGoogleTemplateModel(params: { ctx: ProviderResolveDynamicModelContext; patch?: Partial; }): ProviderRuntimeModel | undefined { - const templateProviderIds = [ - params.providerId, - params.templateProviderId, - ] + const templateProviderIds = [params.providerId, params.templateProviderId] .map((providerId) => providerId?.trim()) .filter((providerId): providerId is string => Boolean(providerId)); diff --git a/extensions/line/src/outbound-media.test.ts b/extensions/line/src/outbound-media.test.ts index 9aad9f0776f..1b715eda4ad 100644 --- a/extensions/line/src/outbound-media.test.ts +++ b/extensions/line/src/outbound-media.test.ts @@ -1,5 +1,9 @@ import { describe, expect, it } from "vitest"; -import { detectLineMediaKind, resolveLineOutboundMedia, validateLineMediaUrl } from "./outbound-media.js"; +import { + detectLineMediaKind, + resolveLineOutboundMedia, + validateLineMediaUrl, +} from "./outbound-media.js"; describe("validateLineMediaUrl", () => { it("accepts HTTPS URL", () => { diff --git a/extensions/line/src/outbound.ts b/extensions/line/src/outbound.ts index 6054bf2eca5..f3d4d49f329 100644 --- a/extensions/line/src/outbound.ts +++ b/extensions/line/src/outbound.ts @@ -30,9 +30,9 @@ function isLineUserTarget(target: string): boolean { function hasLineSpecificMediaOptions(lineData: LineChannelDataWithMedia): boolean { return Boolean( lineData.mediaKind ?? - lineData.previewImageUrl?.trim() ?? - (typeof lineData.durationMs === "number" ? lineData.durationMs : undefined) ?? - lineData.trackingId?.trim(), + lineData.previewImageUrl?.trim() ?? + (typeof lineData.durationMs === "number" ? lineData.durationMs : undefined) ?? + lineData.trackingId?.trim(), ); } diff --git a/extensions/telegram/src/bot-message-context.thread-binding.test.ts b/extensions/telegram/src/bot-message-context.thread-binding.test.ts index 70df2323385..cd264f0a386 100644 --- a/extensions/telegram/src/bot-message-context.thread-binding.test.ts +++ b/extensions/telegram/src/bot-message-context.thread-binding.test.ts @@ -21,11 +21,7 @@ vi.mock("./conversation-route.js", async (importOriginal) => { let buildTelegramMessageContextForTest: typeof import("./bot-message-context.test-harness.js").buildTelegramMessageContextForTest; -function createBoundRoute(params: { - accountId: string; - sessionKey: string; - agentId: string; -}) { +function createBoundRoute(params: { accountId: string; sessionKey: string; agentId: string }) { return { configuredBinding: null, configuredBindingSessionKey: "", diff --git a/src/agents/pi-embedded-runner/run/attempt.ts b/src/agents/pi-embedded-runner/run/attempt.ts index 5aa7401f7d9..959b23baac7 100644 --- a/src/agents/pi-embedded-runner/run/attempt.ts +++ b/src/agents/pi-embedded-runner/run/attempt.ts @@ -153,6 +153,7 @@ import { stripSessionsYieldArtifacts, waitForSessionsYieldAbortSettle, } from "./attempt.sessions-yield.js"; +import { wrapStreamFnHandleSensitiveStopReason } from "./attempt.stop-reason-recovery.js"; import { appendAttemptCacheTtlIfNeeded, composeSystemPromptWithHookContext, @@ -164,7 +165,6 @@ import { wrapStreamFnDecodeXaiToolCallArguments, wrapStreamFnRepairMalformedToolCallArguments, } from "./attempt.tool-call-argument-repair.js"; -import { wrapStreamFnHandleSensitiveStopReason } from "./attempt.stop-reason-recovery.js"; import { wrapStreamFnSanitizeMalformedToolCalls, wrapStreamFnTrimToolCallNames, diff --git a/src/gateway/model-pricing-cache.ts b/src/gateway/model-pricing-cache.ts index 002fa1b10f5..71dfaba22c8 100644 --- a/src/gateway/model-pricing-cache.ts +++ b/src/gateway/model-pricing-cache.ts @@ -8,6 +8,8 @@ import { type ModelRef, } from "../agents/model-selection.js"; import type { OpenClawConfig } from "../config/config.js"; +import { createSubsystemLogger } from "../logging/subsystem.js"; +import { normalizeProviderModelIdWithPlugin } from "../plugins/provider-runtime.js"; import { clearGatewayModelPricingCacheState, getCachedGatewayModelPricing, @@ -15,8 +17,6 @@ import { replaceGatewayModelPricingCache, type CachedModelPricing, } from "./model-pricing-cache-state.js"; -import { createSubsystemLogger } from "../logging/subsystem.js"; -import { normalizeProviderModelIdWithPlugin } from "../plugins/provider-runtime.js"; type OpenRouterPricingEntry = { id: string; diff --git a/src/infra/outbound/payloads.test.ts b/src/infra/outbound/payloads.test.ts index 7839c960fb4..531956f223e 100644 --- a/src/infra/outbound/payloads.test.ts +++ b/src/infra/outbound/payloads.test.ts @@ -56,16 +56,14 @@ describe("normalizeReplyPayloadsForDelivery", () => { expect( normalizeReplyPayloadsForDelivery([ { text: '{"action":"NO_REPLY"}' }, - { text: "{\n \"action\": \"NO_REPLY\"\n}" }, + { text: '{\n "action": "NO_REPLY"\n}' }, ]), ).toEqual([]); }); it("keeps JSON NO_REPLY objects that include extra fields", () => { expect( - normalizeReplyPayloadsForDelivery([ - { text: '{"action":"NO_REPLY","note":"example"}' }, - ]), + normalizeReplyPayloadsForDelivery([{ text: '{"action":"NO_REPLY","note":"example"}' }]), ).toEqual([ { text: '{"action":"NO_REPLY","note":"example"}', diff --git a/src/plugins/bundled-web-search-registry.ts b/src/plugins/bundled-web-search-registry.ts index 73cc65c54ad..2bea890ec4a 100644 --- a/src/plugins/bundled-web-search-registry.ts +++ b/src/plugins/bundled-web-search-registry.ts @@ -14,7 +14,8 @@ export function hasBundledWebSearchCredential(params: { searchConfig?: Record; }): boolean { const searchConfig = - params.searchConfig ?? (params.config.tools?.web?.search as Record | undefined); + params.searchConfig ?? + (params.config.tools?.web?.search as Record | undefined); return resolveBundledPluginWebSearchProviders({ config: params.config, env: params.env, diff --git a/src/security/audit-extra.sync.ts b/src/security/audit-extra.sync.ts index 74649445bc3..7d54c24b835 100644 --- a/src/security/audit-extra.sync.ts +++ b/src/security/audit-extra.sync.ts @@ -23,8 +23,8 @@ import { DEFAULT_DANGEROUS_NODE_COMMANDS, resolveNodeCommandAllowlist, } from "../gateway/node-command-policy.js"; -import { hasBundledWebSearchCredential } from "../plugins/bundled-web-search-registry.js"; import { resolveBrowserConfig } from "../plugin-sdk/browser-runtime.js"; +import { hasBundledWebSearchCredential } from "../plugins/bundled-web-search-registry.js"; import { inferParamBFromIdOrName } from "../shared/model-param-b.js"; import { pickSandboxToolPolicy } from "./audit-tool-policy.js";