@@ -518,6 +518,7 @@ function createDiscordParams(commandBody: string, cfg: OpenClawConfig = baseCfg)
518518 AccountId : "default" ,
519519 } ) ;
520520 params . command . senderId = "user-1" ;
521+ params . command . senderIsOwner = true ;
521522 return params ;
522523}
523524
@@ -752,6 +753,7 @@ function createConversationParams(
752753 ...( fixture . threadParentId ? { ThreadParentId : fixture . threadParentId } : { } ) ,
753754 } ) ;
754755 params . command . senderId = fixture . senderId ?? "user-1" ;
756+ params . command . senderIsOwner = true ;
755757 return params ;
756758}
757759
@@ -896,7 +898,6 @@ async function runInternalAcpCommand(params: {
896898 } ) ;
897899 commandParams . command . channel = INTERNAL_MESSAGE_CHANNEL ;
898900 commandParams . command . senderId = "user-1" ;
899- commandParams . command . senderIsOwner = true ;
900901 return handleAcpCommand ( commandParams , true ) ;
901902}
902903
@@ -1142,6 +1143,37 @@ describe("/acp command", () => {
11421143 expect ( result ?. reply ?. text ) . toContain ( "/acp spawn" ) ;
11431144 } ) ;
11441145
1146+ it . each ( [
1147+ "spawn codex" ,
1148+ "cancel" ,
1149+ "steer continue" ,
1150+ "close" ,
1151+ "status" ,
1152+ "set-mode plan" ,
1153+ "set model gpt-5.5" ,
1154+ "cwd /tmp" ,
1155+ "permissions approve-all" ,
1156+ "timeout 120" ,
1157+ "model openai/gpt-5.5" ,
1158+ "reset-options" ,
1159+ ] ) ( "blocks authorized non-owners from /acp %s" , async ( action ) => {
1160+ const params = createDiscordParams ( `/acp ${ action } ` ) ;
1161+ params . command . senderIsOwner = false ;
1162+
1163+ const result = await handleAcpCommand ( params , true ) ;
1164+
1165+ expect ( result ) . toEqual ( { shouldContinue : false } ) ;
1166+ } ) ;
1167+
1168+ it ( "keeps read-only /acp actions available to authorized non-owners" , async ( ) => {
1169+ const params = createDiscordParams ( "/acp sessions" ) ;
1170+ params . command . senderIsOwner = false ;
1171+
1172+ const result = await handleAcpCommand ( params , true ) ;
1173+
1174+ expect ( result ?. reply ?. text ) . toContain ( "ACP sessions:" ) ;
1175+ } ) ;
1176+
11451177 it ( "spawns an ACP session and binds a Discord thread" , async ( ) => {
11461178 hoisted . ensureSessionMock . mockResolvedValueOnce ( {
11471179 sessionKey : "agent:codex:acp:s1" ,
0 commit comments