Phone confirmation: state number, invite correction only (no "yes")

Call-recording analysis proved the repetitive post-phone silence is NOT volume:
the caller's reply was a full-energy sound right after the (long ~13s) phone
question, but VAD never registered it (no "user started speaking"), so the call
waited until the caller repeated it. Depending on catching a "yes" after a long
utterance is fragile (echo/gate timing).

Fix: stop requiring a "yes". AVA now states the number and invites a correction
only ("...; if that's not the best number, just let me know.") and flows on —
the caller only speaks to correct it. Updated the prompt step, the caller-ID
injection, and the deterministic EndCallProcessor line. Verified 4/4.

Docs: phone step, recording + watchdog entries, recording's post-gate limitation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
tocmo0nlord
2026-06-27 17:57:54 +00:00
parent 80824a7ab0
commit 1cfdf562e2
2 changed files with 27 additions and 14 deletions

19
bot.py
View File

@@ -152,10 +152,11 @@ SYSTEM_PROMPT = (
"ask their last name). From this point on, address the caller by their name. Then ask their "
"insurance (log only — see below) and their preferred day and time (in their own words — "
"see the date rule below).\n"
" 4. VERIFY PHONE — near the end, state the callback number back in ONE line, exactly like: "
"'I have your number as <the number spelled out below> — is that the best number to reach "
"you?'. Do NOT ask permission first ('may I read your number back?') and do NOT skip this "
"step. If it's not right, use the number they give. Don't bring up the phone number before this.\n"
" 4. CONFIRM PHONE (no yes needed) — near the end, STATE the callback number back in one "
"line and invite a CORRECTION ONLY, exactly like: 'I have your number as <the number spelled "
"out below>; if that's not the best number, just let me know.' Do NOT ask a yes/no question, "
"do NOT ask permission, and do NOT wait for them to say 'yes' — flow straight into the wrap-up. "
"Only act on the phone number if they give you a different one. Don't bring it up before this.\n"
" 5. WRAP UP — recap the booking as a REQUEST in one warm sentence (for example, 'I've "
"noted your request to come in tomorrow afternoon at our Kendall office'), make clear a "
"staff member will call back to CONFIRM it, then ASK IF THERE IS ANYTHING ELSE you can help "
@@ -593,9 +594,10 @@ async def run_agent(transport, caller_number=None, call_sid=None, do_capture=Tru
if caller_number:
caller_line = (
f"\n\nCALLER ID: the caller's number on file, written so you read it digit by digit, "
f"is: {_spoken_phone(caller_number)}. When it's time to confirm it (near the end), say "
"it back exactly like that and ask if it's the best number; if they say no, use the "
"number they give. Do not say it any earlier in the call."
f"is: {_spoken_phone(caller_number)}. Near the end, state it back and invite a "
"correction only ('...; if that's not the best number, just let me know.') — do NOT "
"ask a yes/no question or wait for a 'yes'. Only change it if they give a different "
"number. Do not say it any earlier in the call."
)
else:
caller_line = (
@@ -613,8 +615,7 @@ async def run_agent(transport, caller_number=None, call_sid=None, do_capture=Tru
if caller_number:
_spoken = _spoken_phone(caller_number)
phone_confirm_line = (
f"Before you go, let me make sure I have the best number to reach you: "
f"{_spoken}. Is that correct?"
f"Also, I have your number as {_spoken}; if that's not the best number, just let me know."
)
phone_marker = _spoken.split(",")[0].strip() # e.g. "nine seven three"
else: