Skip to content

Commit 7a6a794

Browse files
authored
fix(channels): single-source bundled channel schemas from generated metadata (#131564)
* fix(channels): single-source bundled channel schemas from generated metadata Hand-maintained channelConfigs schema copies in a2a, buzz, clickclack, raft, and slack silently overrode the zod-derived generated bundled channel metadata in config validation: stale buzz/raft copies rejected the valid configWrites key, and the slack/clickclack additionalProperties stubs disabled validation for those channels entirely. Delete the copies so the CI-checked generated metadata is the single channel-schema source, stub feishu's retired rich plugin-entry schema like every sibling, and guard the pattern with a contract test. The retired rich plugin-entry schemas let config UIs park channel settings under plugins.entries.<id>.config unread; the reef doctor migration from #131292 generalizes into the plugin SDK (defineStrayPluginEntryConfigMigration) and feishu adopts it alongside reef. * fix(tests): fold channel schema-source guard into existing shard root A new test root pushed the plugins-platform tsgo shard past its 720-root cap; the guard lives in bundled-package-channel-metadata.test.ts instead. * test(channels): update catalog and parity tests to single-source schemas The official catalog regenerates without the deleted manifest schema copies; the a2a and buzz parity tests drop their cold-manifest/catalog surfaces (the runtime zod projection is what the generator publishes). * test(plugins): lagging slack hydration carries no catalog schema copy The full-suite manifest-registry test still pinned the catalog's retired slack schema fallback; hydration now yields label/description and channel validation falls back to the generated bundled metadata.
1 parent 8d51e41 commit 7a6a794

17 files changed

Lines changed: 269 additions & 772 deletions

‎extensions/a2a/openclaw.plugin.json‎

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -11,80 +11,7 @@
1111
"channelConfigs": {
1212
"a2a": {
1313
"label": "A2A",
14-
"description": "A2A peer authentication, discovery, and task delivery.",
15-
"uiHints": {
16-
"advertisedUrl": {
17-
"label": "Advertised Gateway URL"
18-
},
19-
"peers.*.token": {
20-
"label": "Inbound Bearer Token",
21-
"sensitive": true
22-
},
23-
"peers.*.outboundToken": {
24-
"label": "Outbound Bearer Token",
25-
"sensitive": true
26-
}
27-
},
28-
"schema": {
29-
"type": "object",
30-
"additionalProperties": false,
31-
"properties": {
32-
"enabled": {
33-
"type": "boolean"
34-
},
35-
"configWrites": {
36-
"type": "boolean"
37-
},
38-
"advertisedUrl": {
39-
"type": "string",
40-
"format": "uri",
41-
"pattern": "^https?://"
42-
},
43-
"replyTimeoutMs": {
44-
"type": "integer",
45-
"minimum": 5000,
46-
"maximum": 600000
47-
},
48-
"rateLimitPerMinute": {
49-
"type": "integer",
50-
"minimum": 0
51-
},
52-
"exposeAgents": {
53-
"type": "array",
54-
"items": {
55-
"type": "string"
56-
}
57-
},
58-
"peers": {
59-
"type": "object",
60-
"propertyNames": {
61-
"pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
62-
},
63-
"additionalProperties": {
64-
"type": "object",
65-
"additionalProperties": false,
66-
"required": [
67-
"token"
68-
],
69-
"properties": {
70-
"token": {
71-
"type": "string",
72-
"minLength": 1
73-
},
74-
"url": {
75-
"type": "string",
76-
"format": "uri",
77-
"pattern": "^https?://"
78-
},
79-
"outboundToken": {
80-
"type": "string",
81-
"minLength": 1
82-
}
83-
}
84-
}
85-
}
86-
}
87-
}
14+
"description": "A2A peer authentication, discovery, and task delivery."
8815
}
8916
},
9017
"configSchema": {

‎extensions/a2a/src/channel.test.ts‎

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { readFileSync } from "node:fs";
21
import { verifyChannelMessageAdapterCapabilityProofs } from "openclaw/plugin-sdk/channel-outbound";
32
import { validateJsonSchemaValue } from "openclaw/plugin-sdk/json-schema-runtime";
43
import { describe, expect, it, vi } from "vitest";
@@ -14,34 +13,21 @@ function parseA2aOutboundBody(body: BodyInit | null | undefined): Record<string,
1413
return JSON.parse(body) as Record<string, unknown>;
1514
}
1615

17-
const a2aManifest = JSON.parse(
18-
readFileSync(new URL("../openclaw.plugin.json", import.meta.url), "utf8"),
19-
) as {
20-
channelConfigs: {
21-
a2a: {
22-
schema: Parameters<typeof validateJsonSchemaValue>[0]["schema"];
23-
uiHints: Record<string, { sensitive?: boolean }>;
24-
};
25-
};
26-
};
27-
16+
// Cold (discovery-time) validation uses the zod-derived generated bundled
17+
// channel metadata, which the generator builds from this same config-schema
18+
// module — the manifest carries no schema copy to drift (see #131292).
2819
function assertConfigAcceptance(value: unknown, expected: boolean, label: string): void {
2920
const runtime = a2aPluginConfigSchema.runtime;
3021
if (!runtime) {
3122
throw new Error("expected A2A runtime config schema");
3223
}
3324
expect(runtime.safeParse(value).success, `${label}: runtime`).toBe(expected);
34-
for (const [schemaName, schema] of [
35-
["runtime-json", a2aPluginConfigSchema.schema],
36-
["cold-manifest", a2aManifest.channelConfigs.a2a.schema],
37-
] as const) {
38-
const result = validateJsonSchemaValue({
39-
cacheKey: `a2a.channel.config.${schemaName}`,
40-
schema,
41-
value,
42-
});
43-
expect(result.ok, `${label}: ${schemaName}`).toBe(expected);
44-
}
25+
const result = validateJsonSchemaValue({
26+
cacheKey: "a2a.channel.config.runtime-json",
27+
schema: a2aPluginConfigSchema.schema,
28+
value,
29+
});
30+
expect(result.ok, `${label}: runtime-json`).toBe(expected);
4531
}
4632

4733
describe("A2A channel configuration", () => {
@@ -66,8 +52,6 @@ describe("A2A channel configuration", () => {
6652
);
6753
expect(a2aPluginConfigSchema.uiHints?.["peers.*.token"]?.sensitive).toBe(true);
6854
expect(a2aPluginConfigSchema.uiHints?.["peers.*.outboundToken"]?.sensitive).toBe(true);
69-
expect(a2aManifest.channelConfigs.a2a.uiHints["peers.*.token"]?.sensitive).toBe(true);
70-
expect(a2aManifest.channelConfigs.a2a.uiHints["peers.*.outboundToken"]?.sensitive).toBe(true);
7155
});
7256

7357
it.each([

‎extensions/buzz/openclaw.plugin.json‎

Lines changed: 4 additions & 235 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
"activation": {
66
"onStartup": false
77
},
8-
"channels": ["buzz"],
8+
"channels": [
9+
"buzz"
10+
],
911
"qaRunners": [
1012
{
1113
"commandName": "buzz",
@@ -15,240 +17,7 @@
1517
"channelConfigs": {
1618
"buzz": {
1719
"label": "Buzz",
18-
"description": "Connect OpenClaw agents to Buzz team rooms.",
19-
"schema": {
20-
"$schema": "http://json-schema.org/draft-07/schema#",
21-
"type": "object",
22-
"properties": {
23-
"name": {
24-
"type": "string"
25-
},
26-
"enabled": {
27-
"type": "boolean"
28-
},
29-
"responsePrefix": {
30-
"type": "string"
31-
},
32-
"markdown": {
33-
"type": "object",
34-
"properties": {
35-
"tables": {
36-
"type": "string",
37-
"enum": ["off", "bullets", "code", "block"]
38-
}
39-
},
40-
"additionalProperties": false
41-
},
42-
"relayUrl": {
43-
"allOf": [
44-
{
45-
"type": "string",
46-
"format": "uri"
47-
},
48-
{
49-
"type": "string",
50-
"pattern": "^[wW][sS][sS]?:\\/\\/"
51-
}
52-
]
53-
},
54-
"privateKey": {
55-
"anyOf": [
56-
{
57-
"type": "string"
58-
},
59-
{
60-
"oneOf": [
61-
{
62-
"type": "object",
63-
"properties": {
64-
"source": {
65-
"type": "string",
66-
"const": "env"
67-
},
68-
"provider": {
69-
"type": "string",
70-
"pattern": "^[a-z][a-z0-9_-]{0,63}$"
71-
},
72-
"id": {
73-
"type": "string",
74-
"pattern": "^[A-Z][A-Z0-9_]{0,127}$"
75-
}
76-
},
77-
"required": ["source", "provider", "id"],
78-
"additionalProperties": false
79-
},
80-
{
81-
"type": "object",
82-
"properties": {
83-
"source": {
84-
"type": "string",
85-
"const": "file"
86-
},
87-
"provider": {
88-
"type": "string",
89-
"pattern": "^[a-z][a-z0-9_-]{0,63}$"
90-
},
91-
"id": {
92-
"type": "string"
93-
}
94-
},
95-
"required": ["source", "provider", "id"],
96-
"additionalProperties": false
97-
},
98-
{
99-
"type": "object",
100-
"properties": {
101-
"source": {
102-
"type": "string",
103-
"const": "exec"
104-
},
105-
"provider": {
106-
"type": "string",
107-
"pattern": "^[a-z][a-z0-9_-]{0,63}$"
108-
},
109-
"id": {
110-
"type": "string"
111-
}
112-
},
113-
"required": ["source", "provider", "id"],
114-
"additionalProperties": false
115-
}
116-
]
117-
}
118-
]
119-
},
120-
"authTag": {
121-
"anyOf": [
122-
{
123-
"type": "string"
124-
},
125-
{
126-
"oneOf": [
127-
{
128-
"type": "object",
129-
"properties": {
130-
"source": {
131-
"type": "string",
132-
"const": "env"
133-
},
134-
"provider": {
135-
"type": "string",
136-
"pattern": "^[a-z][a-z0-9_-]{0,63}$"
137-
},
138-
"id": {
139-
"type": "string",
140-
"pattern": "^[A-Z][A-Z0-9_]{0,127}$"
141-
}
142-
},
143-
"required": ["source", "provider", "id"],
144-
"additionalProperties": false
145-
},
146-
{
147-
"type": "object",
148-
"properties": {
149-
"source": {
150-
"type": "string",
151-
"const": "file"
152-
},
153-
"provider": {
154-
"type": "string",
155-
"pattern": "^[a-z][a-z0-9_-]{0,63}$"
156-
},
157-
"id": {
158-
"type": "string"
159-
}
160-
},
161-
"required": ["source", "provider", "id"],
162-
"additionalProperties": false
163-
},
164-
{
165-
"type": "object",
166-
"properties": {
167-
"source": {
168-
"type": "string",
169-
"const": "exec"
170-
},
171-
"provider": {
172-
"type": "string",
173-
"pattern": "^[a-z][a-z0-9_-]{0,63}$"
174-
},
175-
"id": {
176-
"type": "string"
177-
}
178-
},
179-
"required": ["source", "provider", "id"],
180-
"additionalProperties": false
181-
}
182-
]
183-
}
184-
]
185-
},
186-
"groupPolicy": {
187-
"default": "allowlist",
188-
"type": "string",
189-
"enum": ["open", "disabled", "allowlist"]
190-
},
191-
"groupAllowFrom": {
192-
"type": "array",
193-
"items": {
194-
"anyOf": [
195-
{
196-
"type": "string"
197-
},
198-
{
199-
"type": "number"
200-
}
201-
]
202-
}
203-
},
204-
"historyLimit": {
205-
"type": "integer",
206-
"minimum": 0,
207-
"maximum": 20
208-
},
209-
"groups": {
210-
"type": "object",
211-
"propertyNames": {
212-
"type": "string",
213-
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89aAbB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
214-
},
215-
"additionalProperties": {
216-
"type": "object",
217-
"properties": {
218-
"enabled": {
219-
"type": "boolean"
220-
},
221-
"requireMention": {
222-
"type": "boolean"
223-
},
224-
"groupPolicy": {
225-
"type": "string",
226-
"enum": ["open", "disabled", "allowlist"]
227-
},
228-
"groupAllowFrom": {
229-
"type": "array",
230-
"items": {
231-
"anyOf": [
232-
{
233-
"type": "string"
234-
},
235-
{
236-
"type": "number"
237-
}
238-
]
239-
}
240-
}
241-
},
242-
"additionalProperties": false
243-
}
244-
},
245-
"defaultTo": {
246-
"type": "string"
247-
}
248-
},
249-
"required": ["groupPolicy"],
250-
"additionalProperties": false
251-
}
20+
"description": "Connect OpenClaw agents to Buzz team rooms."
25221
}
25322
},
25423
"configSchema": {

0 commit comments

Comments
 (0)