fix: _witness_role_for defensive None handling (T79)
This commit is contained in:
@@ -379,8 +379,15 @@ def _witness_role_for(speaker_bot_id: str, host_bot_id: str | None) -> str:
|
||||
pinned the contract on ``search_memories``; this helper applies it
|
||||
at the call site so a guest-as-speaker doesn't silently retrieve
|
||||
memories under the wrong POV mask.
|
||||
|
||||
When ``host_bot_id`` is ``None`` (degenerate case from a half-seeded
|
||||
chat or Phase-1 path), the speaker is treated as the host so the
|
||||
query falls back to the host POV mask rather than silently masking
|
||||
the speaker's own memories as a guest.
|
||||
"""
|
||||
return "host" if speaker_bot_id == host_bot_id else "guest"
|
||||
if host_bot_id is None or speaker_bot_id == host_bot_id:
|
||||
return "host"
|
||||
return "guest"
|
||||
|
||||
|
||||
def _resolve_addressee(
|
||||
|
||||
Reference in New Issue
Block a user