fix(voice): preserve cancellation intent in staff handoff#39
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e4c790b454
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (isCancellation) { | ||
| logVoiceOperationalStep({ | ||
| eventName: "voice_flow_step", | ||
| callSid, | ||
| stage: "option3_after_hours_cancellation_selected", | ||
| correlationId, | ||
| payload: { reason: "cancellation_inquiry" }, | ||
| }); | ||
| return respondWithCancellationLaneStart("intent"); |
There was a problem hiding this comment.
Prioritize reschedule when both intents are spoken
When a caller says a common phrase like “cancel and reschedule my appointment” in the Press 3 after-hours submenu, both isCancellation and isReschedule are true, but this branch runs first and sends them to the cancellation-only lane, which explicitly does not collect a preferred new time. That drops the reschedule part of the request even though the utterance contains an explicit reschedule intent; the same cancellation-before-reschedule ordering is repeated in the general intent handler below, so mixed cancel/reschedule phrases will be misrouted there as well.
Useful? React with 👍 / 👎.
Summary
Fixes the cancellation-intent follow-up from the staff-controlled reschedule lane.
This PR:
Validation
npm run buildpassedgit diff --checkpassedapi/src/routes/voice.tsapi/tests/voiceRescheduleLane.test.tsivr routing system.txtGuardrails