Skip to content

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

Open
rosetta-livekit-bot[bot] wants to merge 1 commit into
smoker-sobs-excitefrom
mottoes-versed-abated
Open

fix(hotel_receptionist): stop a restaurant modification silently resizing the party#2416
rosetta-livekit-bot[bot] wants to merge 1 commit into
smoker-sobs-excitefrom
mottoes-versed-abated

Conversation

@rosetta-livekit-bot

@rosetta-livekit-bot rosetta-livekit-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • look up the current restaurant reservation before keeping details the same
  • tell the model to omit new_party_size unless the caller states a new count
  • require the updated party size to be read back so callers can catch mistakes

Ports livekit/agents#6806.

Source diff coverage

Source diff coverage
  • examples/hotel_receptionist/tools_restaurant.py: adapted to examples/src/hotel_receptionist/hotel_receptionist.ts. The target consolidates the hotel restaurant tools into one TypeScript file; all three source hunks map to the lookup tool description, modification tool and parameter descriptions, and modification result confirmation directive.
  • Tests: the source PR does not add or modify tests, so there are no source tests to port.

Testing

  • pnpm build
  • pnpm lint (passes with existing warnings)
  • pnpm format:check
  • pnpm --filter livekit-agents-examples test (96 passed, 2 skipped; Vitest exits nonzero because src/testing/survey_agent.test.ts emits two pre-existing asynchronous FakeLLM No input text found errors after its tests complete)

No changeset: the changed examples package is private and excluded from releases.


Ported from livekit/agents#6806

Original PR description

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.

@changeset-bot

changeset-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 9cf4e2e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@rosetta-livekit-bot
rosetta-livekit-bot Bot requested a review from u9g September 3, 2026 16:02

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

0 participants