fix(agent): collision-safe thread keys
This commit is contained in:
parent
2fad1aaa66
commit
083be77404
2 changed files with 14 additions and 2 deletions
|
|
@ -6,7 +6,14 @@ from sdk.agent_session import AgentSessionClient, AgentSessionConfig, build_thre
|
|||
|
||||
|
||||
def test_build_thread_key_uses_platform_user_and_chat_id():
|
||||
assert build_thread_key("matrix", "@alice:example.org", "C1") == "matrix:@alice:example.org:C1"
|
||||
assert build_thread_key("matrix", "@alice:example.org", "C1") == "6:matrix18:@alice:example.org2:C1"
|
||||
|
||||
|
||||
def test_build_thread_key_does_not_collide_when_user_id_contains_colons():
|
||||
left = build_thread_key("matrix", "@alice:example.org", "C1")
|
||||
right = build_thread_key("matrix", "@alice", "example.org:C1")
|
||||
|
||||
assert left != right
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue