Skip to content

fix(hotel_receptionist): give the room-booking flow an exit when no card is taken - #7177

Open
u9g wants to merge 1 commit into
fix/get-card-no-usable-cardfrom
fix/book-room-no-card-exit
Open

fix(hotel_receptionist): give the room-booking flow an exit when no card is taken#7177
u9g wants to merge 1 commit into
fix/get-card-no-usable-cardfrom
fix/book-room-no-card-exit

Conversation

@u9g

@u9g u9g commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Stacked on #6803. That PR lets GetCardTask end without a card via decline_card_capture, which completes the task with a ToolError. On the new-booking path BookRoomTask.open_credit_card_dialog awaited the task without catching it, so the error reached BookRoom's LLM as a bare "couldn't get the card details" while its last directive was still "next: call open_credit_card_dialog". The model reopened the card dialog, and the re-ask loop #6803 removes from the sub-task moved up one level.

  • open_credit_card_dialog catches the ToolError and returns a directive: the booking can't be finalized without a card, offer to finish by callback, call give_up
  • give_up's docstring widens to cover "no card could be taken" so the model has a named exit

The card-update path (start_card_update) already handles the error through the receptionist's own instructions and is unchanged.

Testing

  • pytest examples/hotel_receptionist/ tests/test_tools.py --allow-uncategorized (114 passed)
  • ruff format --check and ruff check clean
  • Scenario 15 ("Caller pushing about a declined card") simulated on this branch: passed. It exercises the card-update path, not this one; nothing in the suite drives a declined capture inside a new booking.

🤖 Generated with Claude Code

…ard is taken

GetCardTask completing with decline_card_capture used to surface to BookRoom
as a bare error while its last directive was still "call
open_credit_card_dialog", so the model reopened the card dialog and the
re-ask loop moved up a level.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants