Book reservations on OpenTable or Resy with explicit confirmations
Book restaurant reservations on OpenTable or Resy using browser automation. All browser operations are executed through the assistant browser CLI, invoked via host_bash.
Each step has a retry budget of 3 attempts. An attempt is one try at the step's primary action (e.g., clicking a button, filling a form, navigating a page). If a step fails after 3 attempts:
If two or more steps require manual fallback, inform the user the automated flow is unreliable and offer to provide the remaining steps as text instructions with links.
Before doing anything, gather the following from the user:
Do not proceed until all required details have been provided.
This is the most important step. Reservation sites require authentication before booking.
Navigate directly to the sign-in page.
https://www.opentable.com/sign-inhttps://resy.com/loginassistant browser --session reservation navigate --url "https://www.opentable.com/sign-in"
Take a snapshot. If you see a sign-in form (email input), continue to sub-step 5 below (fill the email).
assistant browser --session reservation --json snapshot
If the direct URL fails (404, redirect, or any error): fall back to the homepage approach - navigate to the service's homepage and click the "Sign In" / "Log In" button.
If already signed in (you see an account menu, the user's name, or other logged-in indicators), skip to the next step.
Fill the email using assistant browser fill-credential (e.g. service: "opentable" or "resy", field: "email"). Target the element by its element_id - NEVER type into the browser URL bar.
assistant browser --session reservation fill-credential --service opentable --field email --element-id <id>
Click "Continue" / "Sign In" or equivalent submit button.
The site will send a verification code via SMS/email. Use ui_show with surface_type: "form" and await_action: true to ask the user for the code. Wait for the user to submit the form before proceeding - do NOT use any previously collected code. Verification codes expire quickly; only the code from the most recent form submission is valid. Type the freshly submitted code into the verification input on the page.
If the code is rejected, prompt the user again with a fresh ui_show form - never retry an old code.
For password-based login: If the site presents a password field instead of a verification code, fill the password using assistant browser fill-credential (e.g. service: "opentable" or "resy", field: "password").
Before every other action, scan the snapshot for non-functional modal overlays and dismiss them. Modals block all interactions - clicking behind a modal silently fails.
For OpenTable, navigate directly to:
https://www.opentable.com/s?covers=<party_size>&dateTime=<YYYY-MM-DDTHH:MM>&term=<restaurant_or_location>
Construct the URL from the details collected in Step 1. URL-encode the term parameter.
For Resy, navigate to https://resy.com/cities/<city> and use the search/filter UI to find available reservations matching the collected details.
If a specific restaurant was named, navigate directly to its page if possible (e.g. https://www.opentable.com/r/<restaurant-slug> or https://resy.com/cities/<city>/venues/<restaurant-slug>). After landing on the restaurant page, reapply the user's date, time, and party size filters - direct restaurant URLs often show default availability that may not match the user's request. Use the on-page date picker, time selector, and party size controls to set the correct values before reviewing slots.
Take a snapshot and review the results:
assistant browser --session reservation --json snapshot
If the named restaurant is not found on this provider, tell the user and offer to try the other provider (OpenTable <-> Resy). If they agree, go back to Step 3 to sign in to the other provider.
Extract available time slots from the page.
Present them to the user in a clear, organized format.
If NO slots match the requested time:
Let the user choose a slot.
Click the chosen slot on the page to select it. Take a fresh snapshot to confirm the slot is selected and the booking/confirmation form is now visible. Do not proceed to confirmation steps until the slot is actively selected in the site UI.
assistant browser --session reservation click --element-id <slot-id>
assistant browser --session reservation --json snapshot
Before proceeding to book, show the user a summary:
CRITICAL: Surface cancellation policies and fees prominently. Look for and extract:
If the restaurant charges a cancellation or no-show fee, call it out explicitly in a separate line - do not bury it in other details. Example: "This restaurant charges a $25/person no-show fee."
Ask the user to confirm they want to proceed.
Immediately before clicking the final "Complete Reservation" / "Confirm" button, ask one more time:
Only proceed after explicit user approval.
Click the final reservation submit button.
Take a snapshot and screenshot to confirm success:
assistant browser --session reservation --json snapshot
assistant browser --session reservation screenshot --output /tmp/reservation-confirm.jpg
Extract and present to the user:
If the submission fails, take a fresh snapshot and report the error:
assistant browser --session reservation --json snapshot
assistant browser fill-credential and ui_show for verification codes.assistant browser --session reservation --json snapshot and retry with updated element IDs - within the 3-attempt budget per step.element_id from assistant browser snapshot. Never fabricate CSS selectors.assistant browser select-option for native <select> dropdowns (e.g., party size selectors). For non-native dropdowns, ARIA listboxes, and date/time pickers, use ArrowDown/ArrowUp + Enter via assistant browser press-key.assistant browser scroll to reveal off-screen time slots or search results before interacting with them.assistant browser --session reservation --json snapshot). Element IDs go stale after navigation or DOM updates.ui_show with await_action: true.assistant browser --session reservation --json snapshot), read the error message, and report it to the user. Common causes: credit card required, party size changed, slot no longer available. Suggest rebooking if the slot was taken.assistant browser --session reservation navigate --url <current-url>). If still stuck, report to the user.assistant browser --session reservation fill-credential --service opentable --field password --element-id <id>