From c7a562683a64d804bc8d4d5887665abdeec60eb5 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Mon, 6 Apr 2026 15:59:22 +0100 Subject: [PATCH] chore(agents): drop stale lint comments --- src/agents/compaction.token-sanitize.test.ts | 1 - src/agents/openai-ws-stream.test.ts | 1 - ...ded-helpers.sanitizeuserfacingtext.test.ts | 9 ------- .../pi-tools.before-tool-call.e2e.test.ts | 3 --- ...s.before-tool-call.integration.e2e.test.ts | 10 -------- ...ult-guard.tool-result-persist-hook.test.ts | 2 -- src/agents/tool-policy-pipeline.test.ts | 24 ------------------- src/agents/tool-policy.test.ts | 7 ------ 8 files changed, 57 deletions(-) diff --git a/src/agents/compaction.token-sanitize.test.ts b/src/agents/compaction.token-sanitize.test.ts index f7fad927f61..5c97d890771 100644 --- a/src/agents/compaction.token-sanitize.test.ts +++ b/src/agents/compaction.token-sanitize.test.ts @@ -30,7 +30,6 @@ describe("compaction token accounting sanitization", () => { content: [{ type: "text", text: "ok" }], details: { raw: "x".repeat(50_000) }, timestamp: 1, - // oxlint-disable-next-line typescript/no-explicit-any } as any, { role: "user", diff --git a/src/agents/openai-ws-stream.test.ts b/src/agents/openai-ws-stream.test.ts index 6b915902993..77f2fdfcfad 100644 --- a/src/agents/openai-ws-stream.test.ts +++ b/src/agents/openai-ws-stream.test.ts @@ -31,7 +31,6 @@ import { SYSTEM_PROMPT_CACHE_BOUNDARY } from "./system-prompt-cache-boundary.js" // We mock the entire openai-ws-connection module so no real WebSocket is opened. const { MockManager } = vi.hoisted(() => { - // eslint-disable-next-line @typescript-eslint/no-require-imports const { EventEmitter } = require("node:events") as typeof import("node:events"); type AnyFn = (...args: unknown[]) => void; diff --git a/src/agents/pi-embedded-helpers.sanitizeuserfacingtext.test.ts b/src/agents/pi-embedded-helpers.sanitizeuserfacingtext.test.ts index 3d78bb87e9c..3c88bda0af4 100644 --- a/src/agents/pi-embedded-helpers.sanitizeuserfacingtext.test.ts +++ b/src/agents/pi-embedded-helpers.sanitizeuserfacingtext.test.ts @@ -439,7 +439,6 @@ describe("downgradeOpenAIReasoningBlocks", () => { }, ]; - // oxlint-disable-next-line typescript/no-explicit-any expect(downgradeOpenAIReasoningBlocks(input as any)).toEqual(input); }); @@ -457,7 +456,6 @@ describe("downgradeOpenAIReasoningBlocks", () => { { role: "user", content: "next" }, ]; - // oxlint-disable-next-line typescript/no-explicit-any expect(downgradeOpenAIReasoningBlocks(input as any)).toEqual([ { role: "user", content: "next" }, ]); @@ -476,7 +474,6 @@ describe("downgradeOpenAIReasoningBlocks", () => { }, ]; - // oxlint-disable-next-line typescript/no-explicit-any expect(downgradeOpenAIReasoningBlocks(input as any)).toEqual([]); }); @@ -494,7 +491,6 @@ describe("downgradeOpenAIReasoningBlocks", () => { }, ]; - // oxlint-disable-next-line typescript/no-explicit-any expect(downgradeOpenAIReasoningBlocks(input as any)).toEqual(input); }); @@ -512,9 +508,7 @@ describe("downgradeOpenAIReasoningBlocks", () => { { role: "user", content: "next" }, ]; - // oxlint-disable-next-line typescript/no-explicit-any const once = downgradeOpenAIReasoningBlocks(input as any); - // oxlint-disable-next-line typescript/no-explicit-any const twice = downgradeOpenAIReasoningBlocks(once as any); expect(twice).toEqual(once); }); @@ -559,7 +553,6 @@ describe("downgradeOpenAIFunctionCallReasoningPairs", () => { makeToolResult(callIdWithReasoning, "ok"), ]; - // oxlint-disable-next-line typescript/no-explicit-any expect(downgradeOpenAIFunctionCallReasoningPairs(input as any)).toEqual([ makePlainAssistantTurn(callIdWithoutReasoning), makeToolResult(callIdWithoutReasoning, "ok"), @@ -572,7 +565,6 @@ describe("downgradeOpenAIFunctionCallReasoningPairs", () => { makeToolResult(callIdWithReasoning, "ok"), ]; - // oxlint-disable-next-line typescript/no-explicit-any expect(downgradeOpenAIFunctionCallReasoningPairs(input as any)).toEqual(input); }); @@ -584,7 +576,6 @@ describe("downgradeOpenAIFunctionCallReasoningPairs", () => { makeToolResult(callIdWithReasoning, "turn2"), ]; - // oxlint-disable-next-line typescript/no-explicit-any expect(downgradeOpenAIFunctionCallReasoningPairs(input as any)).toEqual([ makePlainAssistantTurn(callIdWithoutReasoning), makeToolResult(callIdWithoutReasoning, "turn1"), diff --git a/src/agents/pi-tools.before-tool-call.e2e.test.ts b/src/agents/pi-tools.before-tool-call.e2e.test.ts index 1e922ee02be..d87bbcc1d44 100644 --- a/src/agents/pi-tools.before-tool-call.e2e.test.ts +++ b/src/agents/pi-tools.before-tool-call.e2e.test.ts @@ -53,7 +53,6 @@ describe("before_tool_call loop detection behavior", () => { hasHooks: vi.fn(), runBeforeToolCall: vi.fn(), }; - // oxlint-disable-next-line typescript/no-explicit-any mockGetGlobalHookRunner.mockReturnValue(hookRunner as any); hookRunner.hasHooks.mockReturnValue(false); }); @@ -180,7 +179,6 @@ describe("before_tool_call loop detection behavior", () => { content: [{ type: "text", text: "(no new output)\n\nProcess still running." }], details: { status: "running", aggregated: "steady" }, }); - // oxlint-disable-next-line typescript/no-explicit-any const tool = wrapToolWithBeforeToolCallHook({ name: "process", execute } as any, { ...disabledLoopDetectionContext, }); @@ -349,7 +347,6 @@ describe("before_tool_call requireApproval handling", () => { hasHooks: vi.fn().mockReturnValue(true), runBeforeToolCall: vi.fn(), }; - // oxlint-disable-next-line typescript/no-explicit-any mockGetGlobalHookRunner.mockReturnValue(hookRunner as any); // Keep the global singleton aligned as a fallback in case another setup path // preloads hook-runner-global before this test's module reset/mocks take effect. diff --git a/src/agents/pi-tools.before-tool-call.integration.e2e.test.ts b/src/agents/pi-tools.before-tool-call.integration.e2e.test.ts index 1430031d7e2..18f7f7b1503 100644 --- a/src/agents/pi-tools.before-tool-call.integration.e2e.test.ts +++ b/src/agents/pi-tools.before-tool-call.integration.e2e.test.ts @@ -90,7 +90,6 @@ describe("before_tool_call hook integration", () => { it("executes tool normally when no hook is registered", async () => { beforeToolCallHook = installBeforeToolCallHook({ enabled: false }); const execute = vi.fn().mockResolvedValue({ content: [], details: { ok: true } }); - // oxlint-disable-next-line typescript/no-explicit-any const tool = wrapToolWithBeforeToolCallHook({ name: "Read", execute } as any, { agentId: "main", sessionKey: "main", @@ -113,7 +112,6 @@ describe("before_tool_call hook integration", () => { runBeforeToolCallImpl: async () => ({ params: { mode: "safe" } }), }); const execute = vi.fn().mockResolvedValue({ content: [], details: { ok: true } }); - // oxlint-disable-next-line typescript/no-explicit-any const tool = wrapToolWithBeforeToolCallHook({ name: "exec", execute } as any); const extensionContext = {} as Parameters[3]; @@ -135,7 +133,6 @@ describe("before_tool_call hook integration", () => { }), }); const execute = vi.fn().mockResolvedValue({ content: [], details: { ok: true } }); - // oxlint-disable-next-line typescript/no-explicit-any const tool = wrapToolWithBeforeToolCallHook({ name: "exec", execute } as any); const extensionContext = {} as Parameters[3]; @@ -154,7 +151,6 @@ describe("before_tool_call hook integration", () => { ]); const execute = vi.fn().mockResolvedValue({ content: [], details: { ok: true } }); - // oxlint-disable-next-line typescript/no-explicit-any const tool = wrapToolWithBeforeToolCallHook({ name: "exec", execute } as any); const extensionContext = {} as Parameters[3]; @@ -174,7 +170,6 @@ describe("before_tool_call hook integration", () => { }, }); const execute = vi.fn().mockResolvedValue({ content: [], details: { ok: true } }); - // oxlint-disable-next-line typescript/no-explicit-any const tool = wrapToolWithBeforeToolCallHook({ name: "read", execute } as any); const extensionContext = {} as Parameters[3]; @@ -189,7 +184,6 @@ describe("before_tool_call hook integration", () => { runBeforeToolCallImpl: async () => undefined, }); const execute = vi.fn().mockResolvedValue({ content: [], details: { ok: true } }); - // oxlint-disable-next-line typescript/no-explicit-any const tool = wrapToolWithBeforeToolCallHook({ name: "ReAd", execute } as any, { agentId: "main", sessionKey: "main", @@ -226,11 +220,9 @@ describe("before_tool_call hook integration", () => { .mockResolvedValueOnce({ params: { marker: "B" } }), }); const execute = vi.fn().mockResolvedValue({ content: [], details: { ok: true } }); - // oxlint-disable-next-line typescript/no-explicit-any const toolA = wrapToolWithBeforeToolCallHook({ name: "Read", execute } as any, { runId: "run-a", }); - // oxlint-disable-next-line typescript/no-explicit-any const toolB = wrapToolWithBeforeToolCallHook({ name: "Read", execute } as any, { runId: "run-b", }); @@ -266,7 +258,6 @@ describe("before_tool_call hook deduplication (#15502)", () => { it("fires hook exactly once when tool goes through wrap + toToolDefinitions", async () => { const execute = vi.fn().mockResolvedValue({ content: [], details: { ok: true } }); - // oxlint-disable-next-line typescript/no-explicit-any const baseTool = { name: "web_fetch", execute, description: "fetch", parameters: {} } as any; const wrapped = wrapToolWithBeforeToolCallHook(baseTool, { @@ -288,7 +279,6 @@ describe("before_tool_call hook deduplication (#15502)", () => { it("fires hook exactly once when tool goes through wrap + abort + toToolDefinitions", async () => { const execute = vi.fn().mockResolvedValue({ content: [], details: { ok: true } }); - // oxlint-disable-next-line typescript/no-explicit-any const baseTool = { name: "Bash", execute, description: "bash", parameters: {} } as any; const abortController = new AbortController(); diff --git a/src/agents/session-tool-result-guard.tool-result-persist-hook.test.ts b/src/agents/session-tool-result-guard.tool-result-persist-hook.test.ts index ad1cce9000c..2520c2ffe8a 100644 --- a/src/agents/session-tool-result-guard.tool-result-persist-hook.test.ts +++ b/src/agents/session-tool-result-guard.tool-result-persist-hook.test.ts @@ -46,7 +46,6 @@ function appendToolCallAndResult(sm: ReturnType) isError: false, content: [{ type: "text", text: "ok" }], details: { big: "x".repeat(10_000) }, - // oxlint-disable-next-line typescript/no-explicit-any } as any); } @@ -56,7 +55,6 @@ function getPersistedToolResult(sm: ReturnType) .filter((e) => e.type === "message") .map((e) => (e as { message: AgentMessage }).message); - // oxlint-disable-next-line typescript/no-explicit-any return messages.find((m) => (m as any).role === "toolResult") as any; } diff --git a/src/agents/tool-policy-pipeline.test.ts b/src/agents/tool-policy-pipeline.test.ts index 8843b8da234..bf1625c5988 100644 --- a/src/agents/tool-policy-pipeline.test.ts +++ b/src/agents/tool-policy-pipeline.test.ts @@ -17,9 +17,7 @@ function runAllowlistWarningStep(params: { const warnings: string[] = []; const tools = [{ name: "exec" }] as unknown as DummyTool[]; applyToolPolicyPipeline({ - // oxlint-disable-next-line typescript/no-explicit-any tools: tools as any, - // oxlint-disable-next-line typescript/no-explicit-any toolMeta: () => undefined, warn: (msg) => warnings.push(msg), steps: [ @@ -44,9 +42,7 @@ describe("tool-policy-pipeline", () => { test("preserves plugin-only allowlists instead of silently stripping them", () => { const tools = [{ name: "exec" }, { name: "plugin_tool" }] as unknown as DummyTool[]; const filtered = applyToolPolicyPipeline({ - // oxlint-disable-next-line typescript/no-explicit-any tools: tools as any, - // oxlint-disable-next-line typescript/no-explicit-any toolMeta: (t: any) => (t.name === "plugin_tool" ? { pluginId: "foo" } : undefined), warn: () => {}, steps: [ @@ -65,9 +61,7 @@ describe("tool-policy-pipeline", () => { const warnings: string[] = []; const tools = [{ name: "exec" }] as unknown as DummyTool[]; applyToolPolicyPipeline({ - // oxlint-disable-next-line typescript/no-explicit-any tools: tools as any, - // oxlint-disable-next-line typescript/no-explicit-any toolMeta: () => undefined, warn: (msg) => warnings.push(msg), steps: [ @@ -123,9 +117,7 @@ describe("tool-policy-pipeline", () => { const warnings: string[] = []; const profilePolicy = resolveToolProfilePolicy("coding"); applyToolPolicyPipeline({ - // oxlint-disable-next-line typescript/no-explicit-any tools: [{ name: "exec" }] as any, - // oxlint-disable-next-line typescript/no-explicit-any toolMeta: () => undefined, warn: (msg) => warnings.push(msg), steps: buildDefaultToolPolicyPipelineSteps({ @@ -142,9 +134,7 @@ describe("tool-policy-pipeline", () => { const warnings: string[] = []; const tools = [{ name: "exec" }] as unknown as DummyTool[]; const params = { - // oxlint-disable-next-line typescript/no-explicit-any tools: tools as any, - // oxlint-disable-next-line typescript/no-explicit-any toolMeta: () => undefined, warn: (msg: string) => warnings.push(msg), steps: [ @@ -168,9 +158,7 @@ describe("tool-policy-pipeline", () => { for (let i = 0; i < 257; i += 1) { applyToolPolicyPipeline({ - // oxlint-disable-next-line typescript/no-explicit-any tools: tools as any, - // oxlint-disable-next-line typescript/no-explicit-any toolMeta: () => undefined, warn: (msg: string) => warnings.push(msg), steps: [ @@ -184,9 +172,7 @@ describe("tool-policy-pipeline", () => { } applyToolPolicyPipeline({ - // oxlint-disable-next-line typescript/no-explicit-any tools: tools as any, - // oxlint-disable-next-line typescript/no-explicit-any toolMeta: () => undefined, warn: (msg: string) => warnings.push(msg), steps: [ @@ -207,9 +193,7 @@ describe("tool-policy-pipeline", () => { for (let i = 0; i < 256; i += 1) { applyToolPolicyPipeline({ - // oxlint-disable-next-line typescript/no-explicit-any tools: tools as any, - // oxlint-disable-next-line typescript/no-explicit-any toolMeta: () => undefined, warn: (msg: string) => warnings.push(msg), steps: [ @@ -225,9 +209,7 @@ describe("tool-policy-pipeline", () => { warnings.length = 0; applyToolPolicyPipeline({ - // oxlint-disable-next-line typescript/no-explicit-any tools: tools as any, - // oxlint-disable-next-line typescript/no-explicit-any toolMeta: () => undefined, warn: (msg: string) => warnings.push(msg), steps: [ @@ -239,9 +221,7 @@ describe("tool-policy-pipeline", () => { ], }); applyToolPolicyPipeline({ - // oxlint-disable-next-line typescript/no-explicit-any tools: tools as any, - // oxlint-disable-next-line typescript/no-explicit-any toolMeta: () => undefined, warn: (msg: string) => warnings.push(msg), steps: [ @@ -256,9 +236,7 @@ describe("tool-policy-pipeline", () => { test("applies allowlist filtering when core tools are explicitly listed", () => { const tools = [{ name: "exec" }, { name: "process" }] as unknown as DummyTool[]; const filtered = applyToolPolicyPipeline({ - // oxlint-disable-next-line typescript/no-explicit-any tools: tools as any, - // oxlint-disable-next-line typescript/no-explicit-any toolMeta: () => undefined, warn: () => {}, steps: [ @@ -275,9 +253,7 @@ describe("tool-policy-pipeline", () => { test("applies deny filtering after allow filtering", () => { const tools = [{ name: "exec" }, { name: "process" }] as unknown as DummyTool[]; const filtered = applyToolPolicyPipeline({ - // oxlint-disable-next-line typescript/no-explicit-any tools: tools as any, - // oxlint-disable-next-line typescript/no-explicit-any toolMeta: () => undefined, warn: () => {}, steps: [ diff --git a/src/agents/tool-policy.test.ts b/src/agents/tool-policy.test.ts index 6c6f0e835e1..cc1b0be5921 100644 --- a/src/agents/tool-policy.test.ts +++ b/src/agents/tool-policy.test.ts @@ -20,24 +20,20 @@ function createOwnerPolicyTools() { return [ { name: "read", - // oxlint-disable-next-line typescript/no-explicit-any execute: async () => ({ content: [], details: {} }) as any, }, { name: "cron", ownerOnly: true, - // oxlint-disable-next-line typescript/no-explicit-any execute: async () => ({ content: [], details: {} }) as any, }, { name: "gateway", ownerOnly: true, - // oxlint-disable-next-line typescript/no-explicit-any execute: async () => ({ content: [], details: {} }) as any, }, { name: "whatsapp_login", - // oxlint-disable-next-line typescript/no-explicit-any execute: async () => ({ content: [], details: {} }) as any, }, ] as unknown as AnyAgentTool[]; @@ -126,7 +122,6 @@ describe("tool-policy", () => { { name: "custom_admin_tool", ownerOnly: true, - // oxlint-disable-next-line typescript/no-explicit-any execute: async () => ({ content: [], details: {} }) as any, }, ] as unknown as AnyAgentTool[]; @@ -148,12 +143,10 @@ describe("tool-policy", () => { const tools = [ { name: "read", - // oxlint-disable-next-line typescript/no-explicit-any execute: async () => ({ content: [], details: {} }) as any, }, { name: "nodes", - // oxlint-disable-next-line typescript/no-explicit-any execute: async () => ({ content: [], details: {} }) as any, }, ] as unknown as AnyAgentTool[];