Skip to content

fix(hotel_receptionist): stop book_room offering views a room type doesn't have - #6804

Open
u9g wants to merge 3 commits into
mainfrom
fix/book-room-single-room-flow
Open

fix(hotel_receptionist): stop book_room offering views a room type doesn't have#6804
u9g wants to merge 3 commits into
mainfrom
fix/book-room-single-room-flow

Conversation

@u9g

@u9g u9g commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Ports the book_room.py changes out of #6567 so they can land on their own.

Summary

  • set_stay's options became one line per room type, each carrying its own view verdict. The single pipe-delimited line (queen 2beds (city or garden views) | ... | double queen (ocean view)) read as one blob, so the model bound a neighboring type's view to the type the caller picked and offered a garden-view double queen — a room that has never existed. The line also says whether the view is a question (two available) or a fact (one), which stops the offer from becoming a false choice.
  • Weekday names in set_stay and in the read-back directive are now computed from the dates instead of left to model day-counting, where a hallucinated weekday survives every read-back.
  • confirm_booking's missing-field guard raised _status(), which reads as "here is the next step" and says nothing about whether a reservation exists. By that point in a multi-room call the model has usually already spoken a real HTL- code, so it invented one and told the caller they were booked. The refusal path now names the outcome; is_error can't carry it, since the OpenAI provider format drops the flag and sends a tool message whose content is that string and nothing else.
  • Instructions state the flow holds exactly one room: set_stay / choose_room replace values rather than adding a second room, so a caller wanting two rooms gets one flow each.

The option formatting moves to hotel_db.describe_room_options in a pure-move commit first, then changes shape.

tools_rooms.py's read-only availability tool still renders views in the old form and is left alone here.

Testing

  • uv run pytest --unit (1942 passed, 5 skipped — unchanged from main)
  • make lint / make format-check
  • Smoke-ran set_stay, _status(), _not_booked(), and describe_room_options against the seeded DB; verified the pure-move commit renders a string identical to the old inline expression

u9g added 3 commits August 11, 2026 16:11
Pure move: describe_room_options renders exactly the string set_stay built
inline.
One pipe-delimited options line let the model carry a neighboring type's view
onto the type the caller picked and offer a garden-view double queen, which
does not exist. Weekday names in set_stay and the read-back are now computed
from the dates rather than left to model day-counting.
confirm_booking's missing-field guard raised _status(), which reads as "here
is the next step" and says nothing about whether a reservation exists. On a
multi-room call the model has already spoken a real HTL- code by then, so it
invented one and told the caller they were booked. The refusal now names the
outcome, and the instructions state the flow holds exactly one room.
@u9g
u9g requested a review from a team as a code owner August 11, 2026 20:25

@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.

Open in 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.

1 participant