@@ -1095,16 +1095,10 @@ describe("config cli", () => {
10951095 setSnapshotOnce ( {
10961096 path : "/tmp/openclaw.json" ,
10971097 exists : true ,
1098- raw : '{"$include":"./agents.json"}' ,
1099- parsed : { $include : "./agents.json" } ,
1100- sourceConfig : {
1101- agents : { list : [ { id : "main" , name : "main" } ] } ,
1102- diagnostics : { otel : { headers : { "0" : "value" } } } ,
1103- } ,
1104- resolved : {
1105- agents : { list : [ { id : "main" , name : "main" } ] } ,
1106- diagnostics : { otel : { headers : { "0" : "value" } } } ,
1107- } ,
1098+ raw : "{}" ,
1099+ parsed : { } ,
1100+ sourceConfig : { } ,
1101+ resolved : { } ,
11081102 valid : true ,
11091103 runtimeConfig : { } ,
11101104 config : { } ,
@@ -1115,8 +1109,6 @@ describe("config cli", () => {
11151109 message :
11161110 'channels.mattermost.dmPolicy="open" but channels.mattermost.allowFrom does not include "*"; all DMs will be dropped.' ,
11171111 } ,
1118- { path : "agents.list.0.name" , message : "agent name warning" } ,
1119- { path : "diagnostics.otel.headers.0" , message : "numeric object key warning" } ,
11201112 ] ,
11211113 legacyIssues : [ ] ,
11221114 } ) ;
@@ -1127,9 +1119,6 @@ describe("config cli", () => {
11271119 expect ( mockError ) . not . toHaveBeenCalled ( ) ;
11281120 expectLogIncludes ( "Config valid:" ) ;
11291121 expectLogIncludes ( "channels.mattermost.allowFrom" ) ;
1130- expectLogIncludes ( "agents.list[0].name" ) ;
1131- expectLogIncludes ( "diagnostics.otel.headers.0" ) ;
1132- expectLogExcludes ( "diagnostics.otel.headers[0]" ) ;
11331122 expectLogIncludes ( "all DMs will be dropped" ) ;
11341123 } ) ;
11351124
@@ -1152,63 +1141,6 @@ describe("config cli", () => {
11521141 expect ( mockLog ) . not . toHaveBeenCalled ( ) ;
11531142 } ) ;
11541143
1155- it ( "formats array indexes only at the human display boundary" , async ( ) => {
1156- setSnapshotOnce (
1157- makeInvalidSnapshot ( {
1158- parsed : { $include : "./agents.json" } ,
1159- sourceConfig : {
1160- agents : {
1161- list : [
1162- {
1163- id : "proof-agent" ,
1164- identity : { avatar : "~/avatar.png" } ,
1165- tools : { exec : { commandHighlighting : true } } ,
1166- } ,
1167- ] ,
1168- } ,
1169- bindings : [
1170- {
1171- type : "acp" ,
1172- agentId : "main" ,
1173- match : { channel : "test" } ,
1174- acp : { label : "claude" } ,
1175- } ,
1176- ] ,
1177- diagnostics : { otel : { headers : { "0" : "value" } } } ,
1178- } ,
1179- issues : [
1180- {
1181- path : "agents.list.0.tools.exec.commandHighlighting" ,
1182- message : "Expected boolean" ,
1183- } ,
1184- {
1185- path : "bindings.0.acp" ,
1186- message : 'Unrecognized key: "agent"' ,
1187- } ,
1188- {
1189- path : "agents.list.0.identity.avatar" ,
1190- message :
1191- "identity.avatar must be a workspace-relative path, http(s) URL, or data URI." ,
1192- } ,
1193- {
1194- path : "diagnostics.otel.headers.0" ,
1195- message : "Expected string" ,
1196- } ,
1197- ] ,
1198- } ) ,
1199- ) ;
1200-
1201- await expect ( runConfigCommand ( [ "config" , "validate" ] ) ) . rejects . toThrow ( "__exit__:1" ) ;
1202-
1203- const output = mockError . mock . calls . map ( ( call ) => String ( call [ 0 ] ) ) . join ( "\n" ) ;
1204- expect ( output ) . toContain ( "agents.list[0].tools.exec.commandHighlighting" ) ;
1205- expect ( output ) . toContain ( "bindings[0].acp" ) ;
1206- expect ( output ) . toContain ( "agents.list[0].identity.avatar" ) ;
1207- expect ( output ) . toContain ( "diagnostics.otel.headers.0" ) ;
1208- expect ( output ) . not . toContain ( "diagnostics.otel.headers[0]" ) ;
1209- expect ( mockLog ) . not . toHaveBeenCalled ( ) ;
1210- } ) ;
1211-
12121144 it ( "replaces doctor advice for plugin packaging compiled-output failures" , async ( ) => {
12131145 setSnapshotOnce (
12141146 makeInvalidSnapshot ( {
@@ -1283,21 +1215,14 @@ describe("config cli", () => {
12831215 it ( "returns machine-readable JSON with --json for invalid config" , async ( ) => {
12841216 setSnapshotOnce (
12851217 makeInvalidSnapshot ( {
1286- parsed : { bindings : [ { acp : { agent : "claude" } } ] } ,
1287- issues : [
1288- { path : "gateway.bind" , message : "Invalid enum value" } ,
1289- { path : "bindings.0.acp" , message : 'Unrecognized key: "agent"' } ,
1290- ] ,
1218+ issues : [ { path : "gateway.bind" , message : "Invalid enum value" } ] ,
12911219 } ) ,
12921220 ) ;
12931221
12941222 const payload = await runValidateJsonAndGetPayload ( ) ;
12951223 expect ( payload . valid ) . toBe ( false ) ;
12961224 expect ( payload . path ) . toBe ( "/tmp/custom-openclaw.json" ) ;
1297- expect ( payload . issues ) . toEqual ( [
1298- { path : "gateway.bind" , message : "Invalid enum value" } ,
1299- { path : "bindings.0.acp" , message : 'Unrecognized key: "agent"' } ,
1300- ] ) ;
1225+ expect ( payload . issues ) . toEqual ( [ { path : "gateway.bind" , message : "Invalid enum value" } ] ) ;
13011226 expect ( mockError ) . not . toHaveBeenCalled ( ) ;
13021227 } ) ;
13031228
0 commit comments