feat: smart @mention booking flow with multi-attendee support#32
Draft
dhairyashiil wants to merge 2 commits intomainfrom
Draft
feat: smart @mention booking flow with multi-attendee support#32dhairyashiil wants to merge 2 commits intomainfrom
dhairyashiil wants to merge 2 commits intomainfrom
Conversation
- Rewrite booking flow in system prompt to clarification-first logic
with fast-path for fully-specified requests
- Add guestEmails field to book_meeting tool for email-only additional
attendees (Strategy A: guests array in initial POST)
- Add add_booking_attendee tool for full attendee records with name +
timezone after booking (Strategy B: POST /bookings/{uid}/attendees)
- Add AddAttendeeInput type and addBookingAttendee() client function
- Add guests field to CreateBookingInput type
- Relax CRITICAL RULES to support multi-step booking flows and
re-calling check_availability for alternative slots
- Update check_availability description to allow re-calls
- Bump MAX_STEPS from 10 to 15 for multi-attendee flows
- Update Available Capabilities to list add_booking_attendee
|
Deployment failed with the following error: View Documentation: https://vercel.com/docs/accounts/team-members-and-roles |
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
feat: smart @mention booking flow with multi-attendee support
Summary
Upgrades the AI agent's booking flow so
@Cal.com book a meeting with @bailey and @Keith Williamsworks end-to-end on Slack and Telegram — with clarification-first logic, multi-attendee resolution, and a fast-path for fully-specified requests.System prompt changes (
lib/agent.ts):check_availabilityfor alternative slots, allows sequential tool calls during booking flows, allows same tool with different arguments (e.g. twolookup_platform_usercalls for two users)Tool & API changes:
book_meeting— adds optionalguestEmails: string[]field, passed asguestsin thePOST /v2/bookingspayload (Strategy A: email-only additional attendees in one call)add_booking_attendee(new) — callsPOST /v2/bookings/{uid}/attendeesto add a full attendee record with name + timezone after booking (Strategy B: for Slack @mentions resolved vialookup_platform_user)CreateBookingInput— addsguests?: string[]AddAttendeeInput(new type) +addBookingAttendee()client functioncheck_availability— description updated to allow re-callsMAX_STEPS— bumped 10 → 15 to accommodate multi-attendee flowsFiles changed:
lib/agent.ts,lib/calcom/client.ts,lib/calcom/types.tsReview & Testing Checklist for Human
POST /v2/bookings/{uid}/attendeesendpoint exists in the Cal.com v2 API and accepts{ name, email, timeZone }. TheaddBookingAttendeefunction assumes this endpoint — if it doesn't exist, theadd_booking_attendeetool will always error at runtime.guestsfield is accepted byPOST /v2/bookings. Thebook_meetingtool now passesguests: ["email@example.com"]— confirm the Cal.com API accepts this and actually adds them to the calendar event.@Cal.com book a meeting with @someoneand verify the agent asks for event type and time instead of silently picking. Try with two @mentions to test multi-attendee flow.@Cal.com book a 30 min meeting with @someone at 3pm tomorrow, go ahead— should book immediately without asking for confirmation.book a meeting with John (john@example.com)— verify it asks for event type and time, then confirms before booking.Notes
ai/chat/zodmodule declarations and Node types — these resolve when dependencies are installed). No new type errors introduced.Link to Devin Session: https://app.devin.ai/sessions/f69e6c70ee544da7b5b6e91a9b73d29b
Requested by: @dhairyashiil