feat(escalations): Escalation Mode wedge — live arrival + magic-moment pickup #155
@@ -583,10 +583,14 @@ async def send_chat_message(
|
|||||||
|
|
||||||
Returns (ai_content, suggested_flows, session, fork_metadata, actions_data, questions_data).
|
Returns (ai_content, suggested_flows, session, fork_metadata, actions_data, questions_data).
|
||||||
"""
|
"""
|
||||||
|
from sqlalchemy import or_
|
||||||
result = await db.execute(
|
result = await db.execute(
|
||||||
select(AISession).where(
|
select(AISession).where(
|
||||||
AISession.id == session_id,
|
AISession.id == session_id,
|
||||||
|
or_(
|
||||||
AISession.user_id == user_id,
|
AISession.user_id == user_id,
|
||||||
|
AISession.escalated_to_id == user_id,
|
||||||
|
),
|
||||||
AISession.session_type == "chat",
|
AISession.session_type == "chat",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user