From 05475629a8524a1fe9e02e7faa11ea37dff6304a Mon Sep 17 00:00:00 2001 From: ingyukoh Date: Thu, 5 Mar 2026 15:49:28 +0900 Subject: [PATCH] fix(discovery): add missing domain to wideArea Zod config schema The wideArea schema uses .strict() but was missing the domain field that is defined in WideAreaDiscoveryConfig type (types.gateway.ts:21) and used across gateway, CLI, and infrastructure code for unicast DNS-SD discovery. Users setting discovery.wideArea.domain in their config get a validation error. Add the field to the schema and a regression test. --- src/config/config.schema-regressions.test.ts | 13 +++++++++++++ src/config/zod-schema.ts | 1 + 2 files changed, 14 insertions(+) diff --git a/src/config/config.schema-regressions.test.ts b/src/config/config.schema-regressions.test.ts index 3e605e06c35..7a6053fd01c 100644 --- a/src/config/config.schema-regressions.test.ts +++ b/src/config/config.schema-regressions.test.ts @@ -211,4 +211,17 @@ describe("config schema regressions", () => { expect(res.ok).toBe(true); }); + + it("accepts discovery.wideArea.domain for unicast DNS-SD", () => { + const res = validateConfigObject({ + discovery: { + wideArea: { + enabled: true, + domain: "openclaw.internal", + }, + }, + }); + + expect(res.ok).toBe(true); + }); }); diff --git a/src/config/zod-schema.ts b/src/config/zod-schema.ts index 1b24eebff4d..0064afddd20 100644 --- a/src/config/zod-schema.ts +++ b/src/config/zod-schema.ts @@ -596,6 +596,7 @@ export const OpenClawSchema = z wideArea: z .object({ enabled: z.boolean().optional(), + domain: z.string().optional(), }) .strict() .optional(),