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.
This commit is contained in:
ingyukoh 2026-03-05 15:49:28 +09:00 committed by Altay
parent e9b1e856a0
commit 05475629a8
No known key found for this signature in database
2 changed files with 14 additions and 0 deletions

View File

@ -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);
});
});

View File

@ -596,6 +596,7 @@ export const OpenClawSchema = z
wideArea: z
.object({
enabled: z.boolean().optional(),
domain: z.string().optional(),
})
.strict()
.optional(),