fix(hotel_receptionist): stop book_room offering views a room type doesn't have - #6804
Open
u9g wants to merge 3 commits into
Open
fix(hotel_receptionist): stop book_room offering views a room type doesn't have#6804u9g wants to merge 3 commits into
u9g wants to merge 3 commits into
Conversation
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.
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.
Ports the
book_room.pychanges 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.set_stayand 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 realHTL-code, so it invented one and told the caller they were booked. The refusal path now names the outcome;is_errorcan't carry it, since the OpenAI provider format drops the flag and sends a tool message whose content is that string and nothing else.set_stay/choose_roomreplace 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_optionsin 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 frommain)make lint/make format-checkset_stay,_status(),_not_booked(), anddescribe_room_optionsagainst the seeded DB; verified the pure-move commit renders a string identical to the old inline expression