@@ -191,7 +191,7 @@ func TestInternalUpsertBindingProjectsInstallationConfigIntoOpenClawEnv(t *testi
191191 s := newInternalSpritzesTestServer (t )
192192 s .presets .byID [0 ].Env = []corev1.EnvVar {{
193193 Name : "OPENCLAW_CONFIG_JSON" ,
194- Value : `{"providers ":{"slack":{"channels":{"C_OLD":{"allow":true,"requireMention":false}}}}}` ,
194+ Value : `{"channels ":{"slack":{"groupPolicy":"allowlist", "channels":{"C_OLD":{"allow":true,"requireMention":false}}}}}` ,
195195 }}
196196 e := echo .New ()
197197 s .registerRoutes (e )
@@ -250,13 +250,16 @@ func TestInternalUpsertBindingProjectsInstallationConfigIntoOpenClawEnv(t *testi
250250 if err := json .Unmarshal ([]byte (openClawConfig ), & projected ); err != nil {
251251 t .Fatalf ("expected valid OpenClaw config JSON, got %s: %v" , openClawConfig , err )
252252 }
253- providers , _ := projected ["providers " ].(map [string ]any )
254- slackConfig , _ := providers ["slack" ].(map [string ]any )
253+ channelsConfig , _ := projected ["channels " ].(map [string ]any )
254+ slackConfig , _ := channelsConfig ["slack" ].(map [string ]any )
255255 channels , _ := slackConfig ["channels" ].(map [string ]any )
256256 channelConfig , _ := channels ["C0ANJGDB4Q5" ].(map [string ]any )
257257 if channelConfig ["allow" ] != true || channelConfig ["requireMention" ] != false {
258258 t .Fatalf ("expected OpenClaw channel policy in env, got %s" , openClawConfig )
259259 }
260+ if slackConfig ["groupPolicy" ] != "allowlist" {
261+ t .Fatalf ("expected existing Slack OpenClaw config to be preserved, got %s" , openClawConfig )
262+ }
260263 if _ , exists := channels ["C_OLD" ]; exists {
261264 t .Fatalf ("expected stale OpenClaw channel policy to be removed, got %s" , openClawConfig )
262265 }
@@ -266,7 +269,7 @@ func TestInternalUpsertBindingProjectsNullInstallationConfigAsEmptyPolicy(t *tes
266269 spec := spritzv1.SpritzSpec {
267270 Env : []corev1.EnvVar {{
268271 Name : "OPENCLAW_CONFIG_JSON" ,
269- Value : `{"providers ":{"slack":{"channels":{"C_OLD":{"allow":true,"requireMention":false}}}}}` ,
272+ Value : `{"channels ":{"slack":{"channels":{"C_OLD":{"allow":true,"requireMention":false}}}}}` ,
270273 }},
271274 }
272275
@@ -293,8 +296,8 @@ func TestInternalUpsertBindingProjectsNullInstallationConfigAsEmptyPolicy(t *tes
293296 if err := json .Unmarshal ([]byte (openClawConfig ), & projected ); err != nil {
294297 t .Fatalf ("expected valid OpenClaw config JSON, got %s: %v" , openClawConfig , err )
295298 }
296- providers , _ := projected ["providers " ].(map [string ]any )
297- slackConfig , _ := providers ["slack" ].(map [string ]any )
299+ channelsConfig , _ := projected ["channels " ].(map [string ]any )
300+ slackConfig , _ := channelsConfig ["slack" ].(map [string ]any )
298301 channels , _ := slackConfig ["channels" ].(map [string ]any )
299302 if len (channels ) != 0 {
300303 t .Fatalf ("expected null installationConfig to remove stale channels, got %s" , openClawConfig )
@@ -331,8 +334,8 @@ func TestInternalUpsertBindingProjectsInstallationConfigWithoutDroppingOpenClawD
331334 if browser ["enabled" ] != true || browser ["executablePath" ] != "/usr/bin/chromium" {
332335 t .Fatalf ("expected OpenClaw browser defaults to be preserved, got %s" , openClawConfig )
333336 }
334- providers , _ := projected ["providers " ].(map [string ]any )
335- slackConfig , _ := providers ["slack" ].(map [string ]any )
337+ channelsConfig , _ := projected ["channels " ].(map [string ]any )
338+ slackConfig , _ := channelsConfig ["slack" ].(map [string ]any )
336339 channels , _ := slackConfig ["channels" ].(map [string ]any )
337340 channelConfig , _ := channels ["C0ANJGDB4Q5" ].(map [string ]any )
338341 if channelConfig ["allow" ] != true || channelConfig ["requireMention" ] != false {
0 commit comments