This is something that's been requested several times over the years, you can search the forum for threads mentioning $caller $calias caller calias etc. There is a similar identifier $caller but this only returns the general type of 'thing' that called the identifier. So, $caller tells you whether something is in a /timer or the editbox or an event etc. It can tell you the $caller identifier was called from within a custom command or custom identifier, but not the name of it You can see more details in https://en.wikichip.org/wiki/mirc/identifiers/$caller

The only way I can think of which currently sort-works is something that's not universal, because it works only if the caller alias creates something the called-alias can see, then must clean up after itself. And, if you don't know which alias called customB, you'd have to go everywhere customB is mentioned and add the extra tracking info.

You can either pass an optional parameter, or create a %global_variable or a hashtable item or a &binary_variable, where all except the 1st requires the caller-alias delete the item so there aren't any later false positives.

Code
alias customA { 
   customB test-text customA
   noop $customB(test-test,customA)
}

alias customB {
   echo -a $2 wants to say $1-
}

alias customA { 
   hadd -m callertable caller customA
   customB test-text
   noop $customB(test-test)
   hdel callertable caller
}

alias customB {
   echo -a $hget(callertable,caller) wants to say $1-
}

alias customA { 
   bset -t &caller customA
   customB test-text
   noop $customB(test-test)
   bunset &caller
}

alias customB {
   echo -a $bvar(&caller,1-).text wants to say $1-
}

alias customA { 
   set %callername customA
   customB test-text
   noop $customB(test-test)
   unset %callername
}

alias customB {
   echo -a %callername wants to say $1-
}


If customB can be called by somthing besides an alias where you defined the answer, you can have conditional logic checking if the answer exists.

if ($2 != $null) do this | else do that
if ($bvar(&caller,0)) do this | else do that
if ($hget(callertable,caller) != $null) do this | else do that
if (%callername != $null) do this | else do that