Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 6 additions & 16 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,22 +234,6 @@ async def connect(self, websocket: WebSocket, resume_text: str, job_description:
self.active_connection = websocket
logger.info(f"WebSocket accepted for session {self.session_id}")

# Update session status to active
async with async_session() as db:
from sqlalchemy import select
result = await db.execute(
select(SessionModel).where(SessionModel.id == self.session_id)
)
session = result.scalar_one_or_none()
if session:
session.status = "active"
await db.commit()

# Pick a random interviewer persona for this session
persona = pick_random_persona()
self._persona = persona

# Determine interview type
interview_type = "solo"
async with async_session() as db:
from sqlalchemy import select
Expand All @@ -258,9 +242,15 @@ async def connect(self, websocket: WebSocket, resume_text: str, job_description:
)
sess = result.scalar_one_or_none()
if sess:
sess.status = "active"
await db.commit()
interview_type = getattr(sess, "interview_type", "solo") or "solo"
self._interview_type = interview_type

# Pick a random interviewer persona for this session
persona = pick_random_persona()
self._persona = persona

# For panel mode, set up multi-agent rotation
if self._interview_type == "panel":
self._panel_names = {p["name"] for p in PANEL_PERSONAS}
Expand Down