From fbaa109a3a20380f41d481829c7bff6a9df4294e Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 4 Jan 2026 01:42:08 +0100 Subject: [PATCH] fix: stabilize lint and test timeouts --- src/agents/clawdis-tools.ts | 18 +++++++++++++++--- src/browser/pw-tools-core.ts | 2 ++ src/gateway/test-helpers.ts | 4 ++-- src/hooks/gmail-setup-utils.test.ts | 2 +- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/agents/clawdis-tools.ts b/src/agents/clawdis-tools.ts index 2ccebff40..3c9c367f0 100644 --- a/src/agents/clawdis-tools.ts +++ b/src/agents/clawdis-tools.ts @@ -2767,7 +2767,11 @@ function createSessionsSendTool(): AnyAgentTool { }); } catch (err) { const message = - err instanceof Error ? err.message : String(err ?? "error"); + err instanceof Error + ? err.message + : typeof err === "string" + ? err + : "error"; return jsonResult({ runId, status: "error", @@ -2792,7 +2796,11 @@ function createSessionsSendTool(): AnyAgentTool { } } catch (err) { const message = - err instanceof Error ? err.message : String(err ?? "error"); + err instanceof Error + ? err.message + : typeof err === "string" + ? err + : "error"; return jsonResult({ runId, status: "error", @@ -2818,7 +2826,11 @@ function createSessionsSendTool(): AnyAgentTool { waitError = typeof wait?.error === "string" ? wait.error : undefined; } catch (err) { const message = - err instanceof Error ? err.message : String(err ?? "error"); + err instanceof Error + ? err.message + : typeof err === "string" + ? err + : "error"; return jsonResult({ runId, status: message.includes("gateway timeout") ? "timeout" : "error", diff --git a/src/browser/pw-tools-core.ts b/src/browser/pw-tools-core.ts index 9d6be2520..473bcc6f3 100644 --- a/src/browser/pw-tools-core.ts +++ b/src/browser/pw-tools-core.ts @@ -213,6 +213,7 @@ export async function evaluateViaPlaywright(opts: { const locator = refLocator(page, opts.ref); // Use Function constructor at runtime to avoid esbuild adding __name helper // which doesn't exist in the browser context + // eslint-disable-next-line @typescript-eslint/no-implied-eval -- required for browser-context eval const elementEvaluator = new Function( "el", "fnBody", @@ -230,6 +231,7 @@ export async function evaluateViaPlaywright(opts: { } // Use Function constructor at runtime to avoid esbuild adding __name helper // which doesn't exist in the browser context + // eslint-disable-next-line @typescript-eslint/no-implied-eval -- required for browser-context eval const browserEvaluator = new Function( "fnBody", ` diff --git a/src/gateway/test-helpers.ts b/src/gateway/test-helpers.ts index 3266b5935..404013e38 100644 --- a/src/gateway/test-helpers.ts +++ b/src/gateway/test-helpers.ts @@ -250,7 +250,7 @@ vi.mock("../config/config.js", async () => { session: { mainKey: "main", store: testState.sessionStorePath, - ...(testState.sessionConfig ?? {}), + ...testState.sessionConfig, }, gateway: (() => { const gateway: Record = {}; @@ -366,7 +366,7 @@ export function installGatewayTestHooks() { piSdkMock.enabled = false; piSdkMock.discoverCalls = 0; piSdkMock.models = []; - }); + }, 20_000); afterEach(async () => { process.env.HOME = previousHome; diff --git a/src/hooks/gmail-setup-utils.test.ts b/src/hooks/gmail-setup-utils.test.ts index 9768843dc..2eeb7da79 100644 --- a/src/hooks/gmail-setup-utils.test.ts +++ b/src/hooks/gmail-setup-utils.test.ts @@ -43,5 +43,5 @@ describe("resolvePythonExecutablePath", () => { process.env.PATH = originalPath; await fs.rm(tmp, { recursive: true, force: true }); } - }); + }, 15_000); });