Problem
During voice-path recovery we reproduced a brittle failure mode behind "Couldn't get assistant": if destination phone extraction or formatting drifts (payload schema variant, 10-digit vs +1 E.164 formatting), call-start can fail to resolve the restaurant and return a hard failure.
Why this matters
- This is a high-impact entrypoint failure: caller hears immediate failure instead of reaching the assistant.
- The failure is avoidable with tolerant parsing + normalization.
- We already have a local patch validated by ci:fast.
Proposed fix
- In
vapi_call_start, broaden destination phone extraction to accept both nested .number and direct string forms across message/call/root variants.
- In shared context lookup, normalize destination + stored restaurant phone values (US 10-digit/11-digit and E.164-ish) before matching.
- Keep behavior unchanged for valid existing payloads; this is strictly hardening.
Acceptance criteria
- Assistant-request succeeds when destination appears as either
phoneNumber.number or phoneNumber string.
- Restaurant lookup resolves despite common US formatting differences (
+1XXXXXXXXXX, 1XXXXXXXXXX, XXXXXXXXXX, punctuation).
- Existing tests remain green (
pnpm ci:fast).
- No tenant-scoping or auth behavior changes.
Notes
- Worktree currently contains unstaged patch implementing this hardening and passing tests.
- Intended to land as a dedicated follow-up commit/PR after current docs/governance commit.
Problem
During voice-path recovery we reproduced a brittle failure mode behind "Couldn't get assistant": if destination phone extraction or formatting drifts (payload schema variant, 10-digit vs +1 E.164 formatting), call-start can fail to resolve the restaurant and return a hard failure.
Why this matters
Proposed fix
vapi_call_start, broaden destination phone extraction to accept both nested.numberand direct string forms across message/call/root variants.Acceptance criteria
phoneNumber.numberorphoneNumberstring.+1XXXXXXXXXX,1XXXXXXXXXX,XXXXXXXXXX, punctuation).pnpm ci:fast).Notes