diff --git a/.oxlintrc.json b/.oxlintrc.json index 2e38313cbc6a..058beaa0cb4f 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -233,6 +233,12 @@ "typescript/unbound-method": "off", "eslint/no-unsafe-optional-chaining": "off" } + }, + { + "files": ["src/agents/embedded-agent-runner/run/attempt.ts"], + "rules": { + "eslint/no-shadow": "error" + } } ] } diff --git a/src/agents/embedded-agent-runner/run/attempt.ts b/src/agents/embedded-agent-runner/run/attempt.ts index 9846b19840f5..01c22d8e8036 100644 --- a/src/agents/embedded-agent-runner/run/attempt.ts +++ b/src/agents/embedded-agent-runner/run/attempt.ts @@ -1422,7 +1422,7 @@ export async function runEmbeddedAttempt( cfg: params.config, }) : undefined; - const bundleMcpRuntime = bundleMcpSessionRuntime + bundleMcpRuntime = bundleMcpSessionRuntime ? await materializeBundleMcpToolsForRun({ runtime: bundleMcpSessionRuntime, reservedToolNames: [ @@ -1436,7 +1436,7 @@ export async function runEmbeddedAttempt( disableTools: params.disableTools || isRawModelRun, toolsAllow: params.toolsAllow, }); - const bundleLspRuntime = bundleLspEnabled + bundleLspRuntime = bundleLspEnabled ? await createBundleLspToolRuntime({ workspaceDir: effectiveWorkspace, cfg: params.config, @@ -2953,13 +2953,6 @@ export async function runEmbeddedAttempt( } let yieldAborted = false; - const getAbortReason = (signal: AbortSignal): unknown => - "reason" in signal ? (signal as { reason?: unknown }).reason : undefined; - const makeTimeoutAbortReason = (): Error => { - const err = new Error("request timed out"); - err.name = "TimeoutError"; - return err; - }; const abortCompaction = () => { if (!activeSession.isCompacting) { return; @@ -3190,7 +3183,6 @@ export async function runEmbeddedAttempt( let abortWarnTimer: NodeJS.Timeout | undefined; const isProbeSession = params.sessionId?.startsWith("probe-") ?? false; - const compactionTimeoutMs = resolveCompactionTimeoutMs(params.config); let abortTimer: NodeJS.Timeout | undefined; let compactionGraceUsed = false; const scheduleAbortTimer = (delayMs: number, reason: "initial" | "compaction-grace") => { diff --git a/test/scripts/oxlint-config.test.ts b/test/scripts/oxlint-config.test.ts index d4d2efaae639..25cead5e0785 100644 --- a/test/scripts/oxlint-config.test.ts +++ b/test/scripts/oxlint-config.test.ts @@ -179,6 +179,12 @@ describe("oxlint config", () => { "eslint/no-unsafe-optional-chaining": "off", }, }, + { + files: ["src/agents/embedded-agent-runner/run/attempt.ts"], + rules: { + "eslint/no-shadow": "error", + }, + }, ]); });