Skip to content
Open
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
6 changes: 6 additions & 0 deletions app/ai/voice/agents/breeze_buddy/template/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,12 @@ async def execute(
)
outcome = "TRANSFERRED"

# Set in-memory outcome AFTER transfer override but BEFORE the
# async DB write. This prevents a race condition in Direct Mode
# where end_conversation_global checks context.lead.outcome and
# defaults to BUSY because the async DB write hasn't completed yet.
context.lead.outcome = outcome

# Update lead in database with outcome
logger.info(
f"Updating lead {context.lead.id} in database with outcome: {outcome}, "
Expand Down
Loading