SearchIndex.create(boolean overwrite, boolean drop) only drops-then-recreates when overwrite is true; otherwise it falls through to an unconditional FT.CREATE, which throws SEARCH_INDEX_EXISTS if the index already exists. There is no "attach if present" branch.
MessageHistory's constructor calls create(false), so you get exactly one MessageHistory per index name for that index's lifetime — resuming a conversation or opening a second session_tag both throw mid-construction. SemanticMessageHistory is affected the same way via its default overwrite=false constructors.
Root cause
public void create(boolean overwrite, boolean drop) {
if (overwrite && exists()) {
delete(drop);
}
create(); // unconditional FT.CREATE — nothing guards on exists() when overwrite == false
}
Expected
Match Python's create(overwrite=False): when the index already exists and overwrite is false, attach to it and return instead of recreating.
Verified against main.
SearchIndex.create(boolean overwrite, boolean drop)only drops-then-recreates whenoverwriteis true; otherwise it falls through to an unconditionalFT.CREATE, which throwsSEARCH_INDEX_EXISTSif the index already exists. There is no "attach if present" branch.MessageHistory's constructor callscreate(false), so you get exactly oneMessageHistoryper index name for that index's lifetime — resuming a conversation or opening a secondsession_tagboth throw mid-construction.SemanticMessageHistoryis affected the same way via its defaultoverwrite=falseconstructors.Root cause
Expected
Match Python's
create(overwrite=False): when the index already exists andoverwriteis false, attach to it and return instead of recreating.Verified against
main.