Repository navigation
Send bespoke welcome message optimistically from frontend - #83496
Conversation
Instead of generating the bespoke welcome message server-side and injecting it into guidedSetupData (which caused INSERT collision risk with optimistic IDs), the frontend now generates the message, displays it optimistically via Onyx, and sends it to the backend as API params. The backend passes it to PAZR as a PREGENERATED_RESPONSE so the LLM appends followups. Old App versions that don not send the new params fall back to the WELCOME_EVENT path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@youssef-lr Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a0e0cb7a91
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…oke action Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
getParsedComment escapes HTML entities before parsing, so raw HTML tags would render as literal text in the optimistic display. Markdown syntax is converted correctly by the parser. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
Ready for review, the web-e PR was deployed to production, so that's enough to test the welcome message and also it's safe to deploy it since it's behind a beta |
|
If this requires C+ review, I can help |
|
@situchan I will need to add you to the beta. What emails should I add? Alternatively, you can use any email with the domain |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-03-03.at.9.58.33.PM.mov |
|
@marcochavezf please merge main. The branch is behind 1.5k commits |
|
@MelvinBot please merge main into this PR |
|
Step 1-5 tests well but
This is not appearing. Signed up with test11@dmb.fun
|
Please add situchandrashil7+83496@gmail.com, situchandrashil7+834961@gmail.com, situchandrashil7+834962@gmail.com |
…welcome-message-frontend Co-authored-by: Marco Chávez <marcochavezf@users.noreply.github.com>
|
Merged |
|
Codex Review: Didn't find any major issues. Hooray! ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Hmm interesting, the follow-ups are not showing immediately since those are generated in the backend and sent via Onyx. I wonder if this is because the backend PR was only deployed to staging? But in that case, we should queue a job in staging too @MelvinBot can you investigate the logs to find out what happened for this account? |
|
I wasn't able to query production/staging logs directly (the VictoriaLogs tools aren't available in this environment), but I traced the full code flow to explain what's happening: Why the bespoke welcome message appears but followup suggestions don'tThe welcome message is frontend-optimistic — it's generated entirely by The followup suggestions are entirely backend-generated — the frontend only parses them from
If step 2-4 never happens (because the backend PR isn't deployed or the agent job isn't queued), the optimistic welcome message persists but no followups ever arrive — which matches the reported behavior. What to check manuallySince I can't query logs, here's what to look for in the staging logs for
Your hypothesis about the backend PR deployment seems likely correct — if the backend handler for these new params isn't active in the environment where testing occurred, the frontend would display the optimistic message but never receive followups. |
|
@marcochavezf This is what I get:
Is it expected? |
|
Hmm thanks @situchan, it should include a message like this one:
The backend PR has been deployed to production, could you try again? |
|
@MelvinBot pull main |
…welcome-message-frontend Co-authored-by: Situ Chandra Shil <situchan@users.noreply.github.com>
|
Merged |
|
Codex Review: Didn't find any major issues. Chef's kiss. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
@mjasikowski Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
🚧 @inimaga has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/inimaga in version: 9.3.31-0 🚀
|
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.3.31-12 🚀
|




On hold for https://github.com/Expensify/Web-Expensify/pull/50949cc @inimaga @Beamanator @mollfpr
Explanation of Change
When onboarding 1-10 company-size users with the
suggestedFollowupsbeta, the frontend now generates the bespoke Concierge welcome message optimistically and sends it to the backend as API params (bespokeWelcomeMessage,optimisticConciergeReportActionID). The backend passes it to the agent as aPREGENERATED_RESPONSEso the LLM appends followups to the pre-displayed message instead of generating a new one.Previously, the backend generated the message server-side and injected it into
guidedSetupDatafor Auth to INSERT, which caused collision risk with the optimistic ID pattern. Now the frontend handles the optimistic display and the backend just routes the message content.Changes:
CompleteGuidedSetupParams.ts— AddedbespokeWelcomeMessageandoptimisticConciergeReportActionIDoptional paramsReportUtils.ts— AddedgetBespokeWelcomeMessage()to generate the welcome message in markdown (markdown is required becausegetParsedCommentescapes raw HTML). Added optimistic/success/failure Onyx data for the bespoke Concierge action inprepareOnboardingOnyxData()ReportUtilsTest.ts— Updated existingprepareOnboardingOnyxDatatest to expect the bespoke action in optimistic data for MICRO + suggestedFollowupsReport/index.ts—completeOnboarding()passes the new params to the APIFixed Issues
$ https://github.com/Expensify/Expensify/issues/601851
Tests
suggestedFollowupsbeta enabledsuggestedFollowupsbeta — verify the old task-based flow still worksOffline tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari