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:
Mingkuan
2026-04-10 17:01:00 +08:00
committed by GitHub
parent 3b6500ca20
commit 005b629b6d
4 changed files with 82 additions and 46 deletions

View File

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