mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 08:40:21 +00:00
fix(qqbot): allow extension fields in channel config schema (#64075)
* fix(qqbot): allow extension fields in channel config schema Use passthrough() on QQBotConfigSchema, QQBotAccountSchema, and QQBotStreamingSchema so third-party builds that share the qqbot channel id can add custom fields without triggering "must NOT have additional properties" validation errors. tts and stt sub-schemas remain strict to preserve typo detection for those sensitive fields. * Update extensions/qqbot/openclaw.plugin.json Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * chore(qqbot): update changelog for config schema passthrough --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
@@ -42,11 +42,15 @@ const QQBotSttSchema = z
|
||||
.optional();
|
||||
|
||||
const QQBotStreamingSchema = z
|
||||
.object({
|
||||
/** "partial" (default) enables block streaming; "off" disables it. */
|
||||
mode: z.enum(["off", "partial"]).default("partial"),
|
||||
})
|
||||
.strict()
|
||||
.union([
|
||||
z.boolean(),
|
||||
z
|
||||
.object({
|
||||
/** "partial" (default) enables block streaming; "off" disables it. */
|
||||
mode: z.enum(["off", "partial"]).default("partial"),
|
||||
})
|
||||
.passthrough(),
|
||||
])
|
||||
.optional();
|
||||
|
||||
const QQBotAccountSchema = z
|
||||
@@ -66,12 +70,12 @@ const QQBotAccountSchema = z
|
||||
upgradeMode: z.enum(["doc", "hot-reload"]).optional(),
|
||||
streaming: QQBotStreamingSchema,
|
||||
})
|
||||
.strict();
|
||||
.passthrough();
|
||||
|
||||
export const QQBotConfigSchema = QQBotAccountSchema.extend({
|
||||
tts: QQBotTtsSchema,
|
||||
stt: QQBotSttSchema,
|
||||
accounts: z.object({}).catchall(QQBotAccountSchema).optional(),
|
||||
accounts: z.object({}).catchall(QQBotAccountSchema.passthrough()).optional(),
|
||||
defaultAccount: z.string().optional(),
|
||||
});
|
||||
}).passthrough();
|
||||
export const qqbotChannelConfigSchema = buildChannelConfigSchema(QQBotConfigSchema);
|
||||
|
||||
Reference in New Issue
Block a user