@@ -85,8 +85,6 @@ function stripPreservedLegacyRootKeysForValidation(
8585
8686const CUSTOM_EXPECTED_ONE_OF_RE = / e x p e c t e d o n e o f ( (?: " [ ^ " ] + " (?: \| " ? [ ^ " ] + " ? ) * ) + ) / i;
8787const SECRETREF_POLICY_DOC_URL = "https://docs.openclaw.ai/reference/secretref-credential-surface" ;
88- const TELEGRAM_GROUPS_SHAPE_HINT =
89- 'Telegram groups must be an object map keyed by Telegram group/chat id, for example channels.telegram.groups."-1001234567890".topics."99" for forum topic routing. Do not use an array, string, or null for channels.telegram.groups; fix the shape, then rerun openclaw doctor --fix for any remaining Telegram config cleanup.' ;
9088const bundledChannelSchemaById = new Map < string , unknown > (
9189 GENERATED_BUNDLED_CHANNEL_CONFIG_METADATA . map (
9290 ( entry ) => [ entry . channelId , entry . schema ] as const ,
@@ -227,22 +225,8 @@ function collectAllowedValuesFromBundledChannelSchemaPath(
227225 return collectAllowedValuesFromJsonSchemaNode ( targetNode ) ;
228226}
229227
230- function isTelegramGroupsConfigPath ( path : string ) : boolean {
231- return (
232- path === "channels.telegram.groups" ||
233- / ^ c h a n n e l s \. t e l e g r a m \. a c c o u n t s \. [ ^ . ] + \. g r o u p s $ / . test ( path )
234- ) ;
235- }
236-
237- function appendTelegramGroupsShapeHint ( path : string , message : string ) : string {
238- if ( ! isTelegramGroupsConfigPath ( path ) || message . includes ( TELEGRAM_GROUPS_SHAPE_HINT ) ) {
239- return message ;
240- }
241- return `${ message } . ${ TELEGRAM_GROUPS_SHAPE_HINT } ` ;
242- }
243-
244- function formatRawChannelConfigIssueMessage ( params : { path : string ; message : string } ) : string {
245- return appendTelegramGroupsShapeHint ( params . path , `invalid config: ${ params . message } ` ) ;
228+ function formatRawChannelConfigIssueMessage ( message : string ) : string {
229+ return `invalid config: ${ message } ` ;
246230}
247231function collectRawBundledChannelConfigIssues ( config : OpenClawConfig ) : ConfigValidationIssue [ ] {
248232 if ( ! config . channels || ! isRecord ( config . channels ) ) {
@@ -270,7 +254,7 @@ function collectRawBundledChannelConfigIssues(config: OpenClawConfig): ConfigVal
270254 error . path === "<root>" ? `channels.${ channelId } ` : `channels.${ channelId } .${ error . path } ` ;
271255 issues . push ( {
272256 path,
273- message : formatRawChannelConfigIssueMessage ( { path , message } ) ,
257+ message : formatRawChannelConfigIssueMessage ( message ) ,
274258 allowedValues : error . allowedValues ,
275259 allowedValuesHiddenCount : error . allowedValuesHiddenCount ,
276260 } ) ;
@@ -575,14 +559,13 @@ function mapZodIssueToConfigIssue(issue: unknown): ConfigValidationIssue {
575559 }
576560 }
577561
578- const messageWithShapeHint = appendTelegramGroupsShapeHint ( path , message ) ;
579562 if ( ! allowedValuesSummary ) {
580- return { path, message : messageWithShapeHint } ;
563+ return { path, message } ;
581564 }
582565
583566 return {
584567 path,
585- message : appendAllowedValuesHint ( messageWithShapeHint , allowedValuesSummary ) ,
568+ message : appendAllowedValuesHint ( message , allowedValuesSummary ) ,
586569 allowedValues : allowedValuesSummary . values ,
587570 allowedValuesHiddenCount : allowedValuesSummary . hiddenCount ,
588571 } ;
@@ -1341,7 +1324,7 @@ function validateConfigObjectWithPluginsBase(
13411324 error . path === "<root>" ? `channels.${ trimmed } ` : `channels.${ trimmed } .${ error . path } ` ;
13421325 issues . push ( {
13431326 path,
1344- message : formatRawChannelConfigIssueMessage ( { path , message : error . message } ) ,
1327+ message : formatRawChannelConfigIssueMessage ( error . message ) ,
13451328 allowedValues : error . allowedValues ,
13461329 allowedValuesHiddenCount : error . allowedValuesHiddenCount ,
13471330 } ) ;
0 commit comments