fix(hotel_receptionist): give card capture a no-usable-card exit - #6803
Open
u9g wants to merge 2 commits into
Open
fix(hotel_receptionist): give card capture a no-usable-card exit#6803u9g wants to merge 2 commits into
u9g wants to merge 2 commits into
Conversation
Cherry-picked from #6567 (2a51757), get_card.py only. A caller whose only card is expired or won't validate had no way out: the expired-date ToolError told the agent to ask for another card, and decline_card_capture was documented as refusal-only, so the agent kept re-asking. Both now route the dead end to decline_card_capture, which ends capture with the booking held.
ShayneP
approved these changes
Aug 13, 2026
…an see GetCardTask never authorizes a charge and is also opened for a new booking that isn't written yet, so it can't promise the booking stays held or judge that a card "keeps failing". The expired-date error now asks to confirm the date first, since a past date in voice is usually a misheard year.
Contributor
Author
|
Pushed a second commit narrowing the wording after review: dropped "the booking stays held" (false on the new-booking path, where nothing is written until |
chenghao-mou
approved these changes
Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A caller whose only card is expired had no way out of
GetCardTask. The expired-dateToolErrortold the agent to ask for another card, anddecline_card_capturewas documented as refusal-only, so the agent kept re-asking a caller who had already said they had nothing else to give.Three changes route that dead end to the existing exit, kept to what the sub-task can actually observe:
decline_card_capturewith the reasonToolErrorfirst asks to confirm the date (a past date in voice is usually a misheard year), and namesdecline_card_captureonly if the card really is expired and there's no other carddecline_card_capture's docstring widens from "the caller explicitly refuses" to also cover the expired-with-no-other-card caseThe sub-task does not speak any reassurance about the booking: it is also opened for a new booking that isn't written yet, so "the booking stays held" would be false there. The caller-facing script for the card-update path stays where it already lives, in the receptionist's instructions.
Follow-up: #7177 (stacked) gives
BookRoomTaska directive when the capture ends without a card, so the loop doesn't move up a level.Cherry-picked from #6567 (2a51757),
get_card.pyonly, then narrowed as above.Testing
pytest examples/hotel_receptionist/ tests/test_tools.py --allow-uncategorized(114 passed)ruff format --checkandruff checkcleanGetCardTaskthroughstart_card_updateand the new wording did not misfire on "I don't have another card on me right now".