From 7d39d84762641ec5642a524f03dd38f8be69b7f4 Mon Sep 17 00:00:00 2001 From: Abimael Martell Date: Thu, 29 Jan 2026 13:00:31 -0800 Subject: [PATCH 1/2] fix: add missing firecrawl schema to tools.web.fetch config --- src/config/zod-schema.agent-runtime.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/config/zod-schema.agent-runtime.ts b/src/config/zod-schema.agent-runtime.ts index 7e95c3538..27c66799c 100644 --- a/src/config/zod-schema.agent-runtime.ts +++ b/src/config/zod-schema.agent-runtime.ts @@ -182,6 +182,18 @@ export const ToolsWebSearchSchema = z .strict() .optional(); +export const ToolsWebFetchFirecrawlSchema = z + .object({ + enabled: z.boolean().optional(), + apiKey: z.string().optional(), + baseUrl: z.string().optional(), + onlyMainContent: z.boolean().optional(), + maxAgeMs: z.number().int().nonnegative().optional(), + timeoutSeconds: z.number().int().positive().optional(), + }) + .strict() + .optional(); + export const ToolsWebFetchSchema = z .object({ enabled: z.boolean().optional(), @@ -190,6 +202,8 @@ export const ToolsWebFetchSchema = z cacheTtlMinutes: z.number().nonnegative().optional(), maxRedirects: z.number().int().nonnegative().optional(), userAgent: z.string().optional(), + readability: z.boolean().optional(), + firecrawl: ToolsWebFetchFirecrawlSchema, }) .strict() .optional(); From 89f3963185f6de9782396ae2a30640b64c22aa2f Mon Sep 17 00:00:00 2001 From: Abimael Martell Date: Thu, 29 Jan 2026 13:08:26 -0800 Subject: [PATCH 2/2] add test --- src/config/config.web-fetch-firecrawl.test.ts | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/config/config.web-fetch-firecrawl.test.ts diff --git a/src/config/config.web-fetch-firecrawl.test.ts b/src/config/config.web-fetch-firecrawl.test.ts new file mode 100644 index 000000000..dab5ee9c1 --- /dev/null +++ b/src/config/config.web-fetch-firecrawl.test.ts @@ -0,0 +1,38 @@ +import { describe, expect, it } from "vitest"; + +import { MoltbotSchema } from "./zod-schema.js"; + +describe("tools.web.fetch.firecrawl config schema", () => { + it("accepts firecrawl nested config", () => { + const res = MoltbotSchema.safeParse({ + tools: { + web: { + fetch: { + firecrawl: { + enabled: true, + baseUrl: "http://localhost:3002", + onlyMainContent: true, + maxAgeMs: 172800000, + }, + }, + }, + }, + }); + + expect(res.success).toBe(true); + }); + + it("accepts readability config", () => { + const res = MoltbotSchema.safeParse({ + tools: { + web: { + fetch: { + readability: false, + }, + }, + }, + }); + + expect(res.success).toBe(true); + }); +});