Gate group speaker isolation to shared chat sessions only.

Per-user group sessions (user_in_chat) already isolate history; keep Sender tags and focus hints only when session_scope=chat (legacy shared __group__ transcripts).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-08-10 23:16:27 +08:00
parent e91e4fe773
commit 9bbac6c0b8
5 changed files with 50 additions and 21 deletions

View file

@ -486,11 +486,18 @@ class OclawGateway:
@staticmethod
def _group_focus_system_hint(msg: StandardMessage, lang: str) -> str:
"""Only for shared group transcripts (legacy session_scope=chat / __group__)."""
md = msg.metadata if isinstance(msg.metadata, dict) else {}
if not bool(md.get("is_group")):
return ""
from runtime.orchestration.group_ingest import build_group_focus_instruction
from runtime.orchestration.group_ingest import (
build_group_focus_instruction,
normalize_group_session_scope,
)
scope = normalize_group_session_scope(md.get("group_session_scope"))
if scope != "chat":
return ""
return str(build_group_focus_instruction(lang=lang) or "").strip()
@staticmethod