I found if I replace
char *userpat = xstrdup("user.*");
userpat[4] = jmap_namespace.hier_sep;
with
char *userpat = xstrdup("Other Users/*");
in jmap_accounts() of jmap_api.c
I'll get my expected result: JMAP sessionResult's`accounts` object includes my primary account and the account shared a mailbox with me.
It seems that cyrus's session implement only matches account in Personal Namespace. I'm confused.