Skip to content

fix(hotel_receptionist): stop a restaurant modification silently resizing the party - #6806

Open
u9g wants to merge 3 commits into
mainfrom
fix/restaurant-modify-party-size
Open

fix(hotel_receptionist): stop a restaurant modification silently resizing the party#6806
u9g wants to merge 3 commits into
mainfrom
fix/restaurant-modify-party-size

Conversation

@u9g

@u9g u9g commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

The examples/hotel_receptionist/tools_restaurant.py changes from #6567, brought in as independent semantic commits so each one stands or falls on its own. Wording is verbatim from #6567. Oldest first:

  1. Look up a restaurant reservation before a "keep it the same" change — a caller who says "same party size, just move it to Friday" leaves the current values only in the reservation record, so nothing the model can see says what "the same" is. lookup_restaurant_reservation now names that case, so the current values are in context before the modification.
  2. Stop modify_restaurant_reservation inventing a party size — "omit to keep the current party size" reads as a description of a default rather than an instruction, so the model fills the parameter anyway, with a number it guessed rather than one the caller stated, and silently resizes the reservation. Omission is now stated as the instruction for that case.
  3. Read the party size back on a restaurant modification — the stored party size is what the modification actually wrote, and confirming only date and time leaves a wrong count unspoken and so uncorrectable. The tool return now directs the read-back, and the docstring says why.

2 and 3 are separate on purpose: 2 keeps a wrong count from being written, 3 catches one that got written anyway, whatever wrote it.

Not included. #6567 also wraps start_restaurant_booking in a try/except RestaurantReservationNotCreatedError. #6801 already covers that case, landing the same behavior differently: BookRestaurantTask completes with a plain ToolError, which propagates out of the await, so the tool needs no catch and no ToolError subclass. One nuance of #6567's wording has no home in either PR — it also tells the agent not to offer to connect or transfer the caller to the restaurant when they ask to hold the table without a phone number. That belongs on #6801's instruction text if it's wanted.

One thing worth a second opinion, inherited from #6567's wording rather than introduced here: under a strict tool schema new_party_size is required with type ["integer", "null"], so the model cannot literally omit it and must pass null instead. Both land as None and both leave the party size untouched (verified below), so the behavior is right in both modes, but "OMIT this parameter" is what a strict-mode model reads.

Testing

  • ruff check and ruff format --check clean on each of the three commits individually
  • Both tool-schema builders (build_legacy_openai_schema and build_strict_openai_schema) carry the new description and parameter text for lookup_restaurant_reservation and modify_restaurant_reservation
  • End to end against a seeded db: a party of 4 moved to a new date/time keeps party_size == 4 both with new_party_size omitted and with it explicitly null, and the tool return reads back 4 guests followed by the new confirm directive

Exercising the tool path at all needs a workaround for a bug this PR does not touch: book_restaurant stores the code lowercase while find_restaurant_reservation uppercases the code it searches for, so no by-code lookup can ever match. That is #6805's second commit. On main today, lookup_restaurant_reservation, cancel_restaurant_reservation, and modify_restaurant_reservation all fail against any reservation booked in-session, independent of anything here.

u9g added 3 commits August 11, 2026 16:50
…eep it the same" change

A caller who says "same party size, just move it to Friday" leaves the current
values only in the reservation record. Point lookup_restaurant_reservation at
that case so the model reads them before modifying.
… a party size

"omit to keep the current party size" reads as a default, so the model fills the
parameter anyway - with the size it guesses rather than one the caller stated,
silently resizing the reservation. Make omission the instruction for that case.
…ification

The stored party size is what the modification actually wrote; confirming only
date and time leaves a wrong count unspoken and so uncorrectable.
@u9g
u9g requested a review from a team as a code owner August 11, 2026 20:56

@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