QQBot schema validation relaxed for extensions
Third-party builds that extend the bundled QQBot channel can now add custom configuration fields without blocking gateway startup.
The bundled QQBot plugin's configuration schema was rejecting custom fields added by third-party builds, causing the gateway to fail at startup with a "must NOT have additional properties" error. This regression was introduced in v2026.4.7 when channel schema validation was changed to apply the bundled schema regardless of whether the qqbot plugin is enabled.
Third-party builds like @tencent-connect/openclaw-qqbot share the same channel ID as the bundled plugin and cannot change it. Any custom field in channels.qqbot would trigger validation failure even if the bundled plugin was disabled.
The fix loosens validation rules at three levels: the top-level qqbot config, individual bot accounts, and the streaming object. All three now accept unknown fields through passthrough mode. Critically, TTS and STT configurations remain strict to preserve typo detection for those sensitive fields — a deliberate tradeoff that balances extensibility with config safety.
The change is purely additive. Third-party builds can now extend the qqbot channel with their own config options while the gateway starts normally.
View Original GitHub Description
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.
<img width="1609" height="321" alt="image" src="https://github.com/user-attachments/assets/962da85c-0d85-472b-8944-f14240618e8b" />Summary
- Problem:
@tencent-connect/openclaw-qqbotbuild that extendschannels.qqbotwith custom fields, fails gateway startup withinvalid config: must NOT have additional propertiessince v2026.4.7, whenensureChannelSchemas()was changed to loadGENERATED_BUNDLED_CHANNEL_CONFIG_METADATAas the primary schema source instead of the runtime plugin registry. - Why it matters:
@tencent-connect/openclaw-qqbotshares the sameqqbotchannel id as the bundled plugin and cannot change it; any field not declared in the bundled schema blocks startup even ifplugins.entries.qqbot.enabled = false. - What changed:
QQBotAccountSchema,QQBotStreamingSchemaobject branch, and top-levelQQBotConfigSchemaswitched from.strict()to.passthrough();generated.tsregenerated;openclaw.plugin.jsontop-level and accountadditionalPropertiesset totrue. - What did NOT change:
QQBotTtsSchemaandQQBotSttSchemaremain.strict()to preserve field-name typo detection for TTS/STT configuration.
Change Type
- Bug fix
Scope
- Integrations
- API / contracts
Linked Issue/PR
- Closes #
- This PR fixes a bug or regression
Root Cause
- Root cause:
1a63f5b972(v2026.4.7, "fix: preserve plugin auto-enable activation context") changedensureChannelSchemas()insrc/config/validation.tsto loadGENERATED_BUNDLED_CHANNEL_CONFIG_METADATAas the primary schema source before the runtime plugin registry. As a result, the bundled qqbot schema (which usesadditionalProperties: false) is always applied regardless of whether the qqbot plugin is enabled or overridden by a third-party build. Before v2026.4.7, channel schemas were sourced exclusively from the runtime registry, so a disabled or absent qqbot plugin meant no schema existed and validation was skipped. - Missing detection / guardrail: No test covered the case where a third-party build shares a bundled channel id and adds fields not declared in the bundled schema.
- Contributing context: qqbot was added as a bundled channel plugin (
bf6f506dfa, 2026-03-31) withadditionalProperties: falseon all schema levels. The schema change in1a63f5b972was aimed at a different problem (plugin auto-enable context) and the qqbot extensibility impact was not anticipated.
Regression Test Plan
- Coverage level that should have caught this:
- Unit test
- Target test or file:
src/config/validation.channel-passthrough.test.ts - Scenario the test should lock in: config containing
channels.qqbotwith an unknown top-level field passes validation without errors - Why this is the smallest reliable guardrail: directly exercises the JSON Schema validation path in
validateConfigObjectWithPlugins - Existing test that already covers this (if any): None
- If no new test is added, why not: The fix is in schema definition; behavior is covered by existing channel config validation tests that verify
additionalProperties: {}allows extra fields
User-visible / Behavior Changes
channels.qqbot,channels.qqbot.accounts.*, andchannels.qqbot.*.streamingnow accept unknown fields without validation errors. This is required for@tencent-connect/openclaw-qqbotusers who configure additional fields in these sections.channels.qqbot.ttsandchannels.qqbot.stt(and nested sub-objects) still reject unknown fields.
Diagram
Before (v2026.4.7+):
channels.qqbot: { myCustomField: "x" }
-> GENERATED_BUNDLED schema (additionalProperties: false)
-> validation error
-> gateway fails to start
After:
channels.qqbot: { myCustomField: "x" }
-> GENERATED_BUNDLED schema (additionalProperties: true / passthrough)
-> validation passes
-> gateway starts
Security Impact
- New permissions/capabilities? No
- Secrets/tokens handling changed? No
- New/changed network calls? No
- Command/tool execution surface changed? No
- Data access scope changed? No
Repro + Verification
Environment
- OS: Linux (server)
- Runtime/container: Node 22
- Integration/channel: qqbot (
@tencent-connect/openclaw-qqbot) - Relevant config:
{ "channels": { "qqbot": { "appId": "xxx", "accounts": { "bot2": { "appId": "yyy", "customField": "zzz" } } } } }
Steps
- Install openclaw >= v2026.4.7 with qqbot bundled
- Install
@tencent-connect/openclaw-qqbotand configure it with custom fields inchannels.qqbot.accounts.<id> - Run
openclaw gateway run
Expected
- Gateway starts successfully
Actual (before fix)
Config invalid: channels.qqbot: invalid config: must NOT have additional properties
Evidence
- Failing test/log before + passing after
Human Verification
- Verified scenarios: gateway starts with extra fields in
channels.qqbotandchannels.qqbot.accounts.* - Edge cases checked:
tts/stttypo detection still works; streaming object mode enum still validated - What you did not verify: behavior on Windows; behavior when qqbot plugin is fully uninstalled
Compatibility / Migration
- Backward compatible? Yes
- Config/env changes? No
- Migration needed? No
Risks and Mitigations
- Risk: Loosening schema allows typos in
channels.qqbottop-level fields to pass silently (e.g.appldinstead ofappId)- Mitigation: Only top-level, account, and streaming object are passthrough; tts/stt remain strict. Core account fields (appId, clientSecret) are consumed by the runtime which will surface missing-value errors at connection time rather than config load time.