diff --git a/.oxlintrc.json b/.oxlintrc.json index 7037f292991..2143000aeea 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -61,7 +61,6 @@ "rules": { "typescript/no-base-to-string": "off", "typescript/no-explicit-any": "off", - "typescript/no-floating-promises": "off", "typescript/no-redundant-type-constituents": "off", "typescript/unbound-method": "off", "eslint/no-unsafe-optional-chaining": "off" diff --git a/extensions/active-memory/index.test.ts b/extensions/active-memory/index.test.ts index 942ddc49d6f..75d3f73ad9d 100644 --- a/extensions/active-memory/index.test.ts +++ b/extensions/active-memory/index.test.ts @@ -111,7 +111,7 @@ describe("active-memory plugin", () => { runEmbeddedPiAgent.mockResolvedValue({ payloads: [{ text: "- lemon pepper wings\n- blue cheese" }], }); - plugin.register(api as unknown as OpenClawPluginApi); + await plugin.register(api as unknown as OpenClawPluginApi); }); afterEach(async () => { @@ -406,7 +406,7 @@ describe("active-memory plugin", () => { agents: ["main"], allowedChatTypes: ["direct", "group"], }; - plugin.register(api as unknown as OpenClawPluginApi); + await plugin.register(api as unknown as OpenClawPluginApi); const result = await hooks.before_prompt_build( { prompt: "what wings should we order?", messages: [] }, @@ -509,7 +509,7 @@ describe("active-memory plugin", () => { agents: ["main"], queryMode: "message", }; - plugin.register(api as unknown as OpenClawPluginApi); + await plugin.register(api as unknown as OpenClawPluginApi); await hooks.before_prompt_build( { @@ -537,7 +537,7 @@ describe("active-memory plugin", () => { queryMode: "message", promptStyle: "preference-only", }; - plugin.register(api as unknown as OpenClawPluginApi); + await plugin.register(api as unknown as OpenClawPluginApi); await hooks.before_prompt_build( { @@ -582,7 +582,7 @@ describe("active-memory plugin", () => { agents: ["main"], thinking: "medium", }; - plugin.register(api as unknown as OpenClawPluginApi); + await plugin.register(api as unknown as OpenClawPluginApi); await hooks.before_prompt_build( { @@ -608,7 +608,7 @@ describe("active-memory plugin", () => { agents: ["main"], promptAppend: "Prefer stable long-term preferences over one-off events.", }; - plugin.register(api as unknown as OpenClawPluginApi); + await plugin.register(api as unknown as OpenClawPluginApi); await hooks.before_prompt_build( { @@ -637,7 +637,7 @@ describe("active-memory plugin", () => { promptOverride: "Custom memory prompt. Return NONE or one user fact.", promptAppend: "Extra custom instruction.", }; - plugin.register(api as unknown as OpenClawPluginApi); + await plugin.register(api as unknown as OpenClawPluginApi); await hooks.before_prompt_build( { @@ -710,7 +710,7 @@ describe("active-memory plugin", () => { api.pluginConfig = { agents: ["main"], }; - plugin.register(api as unknown as OpenClawPluginApi); + await plugin.register(api as unknown as OpenClawPluginApi); await hooks.before_prompt_build( { prompt: "what wings should i order? temp transcript", messages: [] }, @@ -735,7 +735,7 @@ describe("active-memory plugin", () => { agents: ["main"], modelFallbackPolicy: "resolved-only", }; - plugin.register(api as unknown as OpenClawPluginApi); + await plugin.register(api as unknown as OpenClawPluginApi); const result = await hooks.before_prompt_build( { prompt: "what wings should i order? no fallback", messages: [] }, @@ -872,7 +872,7 @@ describe("active-memory plugin", () => { timeoutMs: 250, logging: true, }; - plugin.register(api as unknown as OpenClawPluginApi); + await plugin.register(api as unknown as OpenClawPluginApi); let lastAbortSignal: AbortSignal | undefined; runEmbeddedPiAgent.mockImplementation(async (params: { abortSignal?: AbortSignal }) => { lastAbortSignal = params.abortSignal; @@ -918,7 +918,7 @@ describe("active-memory plugin", () => { agents: ["main"], logging: true, }; - plugin.register(api as unknown as OpenClawPluginApi); + await plugin.register(api as unknown as OpenClawPluginApi); await hooks.before_prompt_build( { prompt: "what wings should i order? session id cache", messages: [] }, @@ -1037,7 +1037,7 @@ describe("active-memory plugin", () => { agents: ["main"], queryMode: "message", }; - plugin.register(api as unknown as OpenClawPluginApi); + await plugin.register(api as unknown as OpenClawPluginApi); await hooks.before_prompt_build( { @@ -1065,7 +1065,7 @@ describe("active-memory plugin", () => { agents: ["main"], queryMode: "full", }; - plugin.register(api as unknown as OpenClawPluginApi); + await plugin.register(api as unknown as OpenClawPluginApi); await hooks.before_prompt_build( { @@ -1096,7 +1096,7 @@ describe("active-memory plugin", () => { agents: ["main"], queryMode: "recent", }; - plugin.register(api as unknown as OpenClawPluginApi); + await plugin.register(api as unknown as OpenClawPluginApi); await hooks.before_prompt_build( { @@ -1174,7 +1174,7 @@ describe("active-memory plugin", () => { agents: ["main"], maxSummaryChars: 40, }; - plugin.register(api as unknown as OpenClawPluginApi); + await plugin.register(api as unknown as OpenClawPluginApi); runEmbeddedPiAgent.mockResolvedValueOnce({ payloads: [ { @@ -1211,7 +1211,7 @@ describe("active-memory plugin", () => { agents: ["main"], maxSummaryChars: 90, }; - plugin.register(api as unknown as OpenClawPluginApi); + await plugin.register(api as unknown as OpenClawPluginApi); await hooks.before_prompt_build( { prompt: "what wings should i order? prompt-count-check", messages: [] }, @@ -1261,7 +1261,7 @@ describe("active-memory plugin", () => { transcriptDir: "active-memory-subagents", logging: true, }; - plugin.register(api as unknown as OpenClawPluginApi); + await plugin.register(api as unknown as OpenClawPluginApi); const mkdirSpy = vi.spyOn(fs, "mkdir").mockResolvedValue(undefined); const mkdtempSpy = vi.spyOn(fs, "mkdtemp"); const rmSpy = vi.spyOn(fs, "rm").mockResolvedValue(undefined); @@ -1305,7 +1305,7 @@ describe("active-memory plugin", () => { transcriptDir: "C:/temp/escape", logging: true, }; - plugin.register(api as unknown as OpenClawPluginApi); + await plugin.register(api as unknown as OpenClawPluginApi); const mkdirSpy = vi.spyOn(fs, "mkdir").mockResolvedValue(undefined); await hooks.before_prompt_build( @@ -1342,7 +1342,7 @@ describe("active-memory plugin", () => { transcriptDir: "active-memory-subagents", logging: true, }; - plugin.register(api as unknown as OpenClawPluginApi); + await plugin.register(api as unknown as OpenClawPluginApi); const mkdirSpy = vi.spyOn(fs, "mkdir").mockResolvedValue(undefined); await hooks.before_prompt_build( @@ -1409,7 +1409,7 @@ describe("active-memory plugin", () => { agents: ["main"], logging: true, }; - plugin.register(api as unknown as OpenClawPluginApi); + await plugin.register(api as unknown as OpenClawPluginApi); for (let index = 0; index <= 1000; index += 1) { await hooks.before_prompt_build( diff --git a/extensions/anthropic/stream-wrappers.test.ts b/extensions/anthropic/stream-wrappers.test.ts index f219b17604e..b82c74d0128 100644 --- a/extensions/anthropic/stream-wrappers.test.ts +++ b/extensions/anthropic/stream-wrappers.test.ts @@ -18,7 +18,7 @@ function runWrapper(apiKey: string | undefined): Record | undefi return {} as never; }; const wrapper = createAnthropicBetaHeadersWrapper(base, [CONTEXT_1M_BETA]); - wrapper( + void wrapper( { provider: "anthropic", id: "claude-opus-4-6" } as never, {} as never, { apiKey } as never, @@ -64,7 +64,7 @@ describe("anthropic stream wrappers", () => { extraParams: { context1m: true, serviceTier: "auto" }, } as never); - wrapped?.( + void wrapped?.( { provider: "anthropic", api: "anthropic-messages", id: "claude-sonnet-4-6" } as never, {} as never, { apiKey: "sk-ant-oat01-oauth-token" } as never, @@ -91,7 +91,7 @@ describe("anthropic stream wrappers", () => { extraParams: { context1m: true, serviceTier: "auto" }, } as never); - wrapped?.( + void wrapped?.( { provider: "anthropic", api: "anthropic-messages", id: "claude-sonnet-4-6" } as never, {} as never, { apiKey: "sk-ant-api-123" } as never, @@ -121,7 +121,7 @@ describe("createAnthropicFastModeWrapper", () => { }; const wrapper = createAnthropicFastModeWrapper(base, params.enabled ?? true); - wrapper( + void wrapper( { provider: params.provider ?? "anthropic", api: params.api ?? "anthropic-messages", @@ -177,7 +177,7 @@ describe("createAnthropicServiceTierWrapper", () => { }; const wrapper = createAnthropicServiceTierWrapper(base, params.serviceTier ?? "auto"); - wrapper( + void wrapper( { provider: params.provider ?? "anthropic", api: params.api ?? "anthropic-messages", diff --git a/extensions/device-pair/index.test.ts b/extensions/device-pair/index.test.ts index ba80729929a..f1056c6b1d4 100644 --- a/extensions/device-pair/index.test.ts +++ b/extensions/device-pair/index.test.ts @@ -92,7 +92,7 @@ function registerPairCommand(params?: { pluginConfig?: Record; }): OpenClawPluginCommandDefinition { let command: OpenClawPluginCommandDefinition | undefined; - registerDevicePair.register( + void registerDevicePair.register( createApi({ ...params, registerCommand: (nextCommand) => { diff --git a/extensions/feishu/src/monitor.bot-menu.test.ts b/extensions/feishu/src/monitor.bot-menu.test.ts index 07f538afbb1..df54b148386 100644 --- a/extensions/feishu/src/monitor.bot-menu.test.ts +++ b/extensions/feishu/src/monitor.bot-menu.test.ts @@ -169,7 +169,7 @@ describe("Feishu bot menu handler", () => { createBotMenuEvent({ eventKey: "quick-actions", timestamp: "1700000000001" }), ); let settled = false; - pending.finally(() => { + void pending.finally(() => { settled = true; }); diff --git a/extensions/github-copilot/stream.test.ts b/extensions/github-copilot/stream.test.ts index ef8045434b5..120e7b003b9 100644 --- a/extensions/github-copilot/stream.test.ts +++ b/extensions/github-copilot/stream.test.ts @@ -40,7 +40,7 @@ describe("wrapCopilotAnthropicStream", () => { hasImages: true, }); - wrapped( + void wrapped( { provider: "github-copilot", api: "anthropic-messages", @@ -76,7 +76,7 @@ describe("wrapCopilotAnthropicStream", () => { const wrapped = wrapCopilotAnthropicStream(baseStreamFn); const options = { headers: { Existing: "1" } }; - wrapped( + void wrapped( { provider: "github-copilot", api: "openai-responses", @@ -96,7 +96,7 @@ describe("wrapCopilotAnthropicStream", () => { streamFn: baseStreamFn, } as never); - wrapped( + void wrapped( { provider: "github-copilot", api: "openai-responses", diff --git a/extensions/openrouter/index.test.ts b/extensions/openrouter/index.test.ts index 51690e84d25..2623b164dce 100644 --- a/extensions/openrouter/index.test.ts +++ b/extensions/openrouter/index.test.ts @@ -73,7 +73,7 @@ describe("openrouter provider hooks", () => { thinkingLevel: "high", } as never); - wrapped?.( + void wrapped?.( { provider: "openrouter", api: "openai-completions", diff --git a/extensions/phone-control/index.test.ts b/extensions/phone-control/index.test.ts index ac3e4b5c72b..f2de1802fed 100644 --- a/extensions/phone-control/index.test.ts +++ b/extensions/phone-control/index.test.ts @@ -80,7 +80,7 @@ async function withRegisteredPhoneControl( }); let command: OpenClawPluginCommandDefinition | undefined; - registerPhoneControl.register( + void registerPhoneControl.register( createApi({ stateDir, getConfig: () => config, diff --git a/extensions/talk-voice/index.test.ts b/extensions/talk-voice/index.test.ts index fccea5bac0e..80a3fb7e151 100644 --- a/extensions/talk-voice/index.test.ts +++ b/extensions/talk-voice/index.test.ts @@ -20,7 +20,7 @@ function createHarness(config: Record) { command = definition; }), }; - register.register(api as never); + void register.register(api as never); if (!command) { throw new Error("talk-voice command not registered"); } diff --git a/extensions/thread-ownership/index.test.ts b/extensions/thread-ownership/index.test.ts index 8cb354a96c1..231db2b5adf 100644 --- a/extensions/thread-ownership/index.test.ts +++ b/extensions/thread-ownership/index.test.ts @@ -40,8 +40,8 @@ describe("thread-ownership plugin", () => { }); describe("message_sending", () => { - beforeEach(() => { - register.register(api as unknown as OpenClawPluginApi); + beforeEach(async () => { + await register.register(api as unknown as OpenClawPluginApi); }); async function sendSlackThreadMessage() { @@ -112,8 +112,8 @@ describe("thread-ownership plugin", () => { }); describe("message_received @-mention tracking", () => { - beforeEach(() => { - register.register(api as unknown as OpenClawPluginApi); + beforeEach(async () => { + await register.register(api as unknown as OpenClawPluginApi); }); it("tracks @-mentions and skips ownership check for mentioned threads", async () => { diff --git a/src/auto-reply/reply/agent-runner-execution.test.ts b/src/auto-reply/reply/agent-runner-execution.test.ts index 290b5afd76c..cc61addd40b 100644 --- a/src/auto-reply/reply/agent-runner-execution.test.ts +++ b/src/auto-reply/reply/agent-runner-execution.test.ts @@ -342,8 +342,8 @@ describe("runAgentTurnWithFallback", () => { delivered.push(payload.text ?? ""); }); state.runEmbeddedPiAgentMock.mockImplementationOnce(async (params: EmbeddedAgentParams) => { - params.onToolResult?.({ text: "first", mediaUrls: [] }); - params.onToolResult?.({ text: "second", mediaUrls: [] }); + void params.onToolResult?.({ text: "first", mediaUrls: [] }); + void params.onToolResult?.({ text: "second", mediaUrls: [] }); return { payloads: [{ text: "final" }], meta: {} }; }); @@ -388,8 +388,8 @@ describe("runAgentTurnWithFallback", () => { deliveryOrder.push(payload.text ?? ""); }); state.runEmbeddedPiAgentMock.mockImplementationOnce(async (params: EmbeddedAgentParams) => { - params.onToolResult?.({ text: "first", mediaUrls: [] }); - params.onToolResult?.({ text: "second", mediaUrls: [] }); + void params.onToolResult?.({ text: "first", mediaUrls: [] }); + void params.onToolResult?.({ text: "second", mediaUrls: [] }); return { payloads: [{ text: "final" }], meta: {} }; }); diff --git a/src/gateway/server-methods/commands.test.ts b/src/gateway/server-methods/commands.test.ts index f47a54eaa71..427fa6bcea7 100644 --- a/src/gateway/server-methods/commands.test.ts +++ b/src/gateway/server-methods/commands.test.ts @@ -139,7 +139,7 @@ function callHandler(params: Record = {}) { const respond = (ok: boolean, payload?: unknown, error?: unknown) => { result = { ok, payload, error }; }; - commandsHandlers["commands.list"]({ + void commandsHandlers["commands.list"]({ params, respond, req: {} as never,