Skip to content

[Payment due @huult] Render server-driven AZ status on expense reports - #95959

Merged
cristipaval merged 10 commits into
mainfrom
issa/Render-server-driven-AZ-status-on-expense-reports
Jul 23, 2026
Merged

cristipaval merged 10 commits into
mainfrom
issa/Render-server-driven-AZ-status-on-expense-reports

Conversation

@inimaga

@inimaga inimaga commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Held on:

This PR updates the AgentZero status provider so non-chat reports can mount the status gate when the server has written an AgentZero processing indicator NVP, allowing parent expense reports to show server-driven thinking/status bubbles. Expense reports without server status still skip optimistic kickoff, and unit coverage now verifies both the server-driven render path and the quiet default path.

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/651801
PROPOSAL: N/A

Tests

  • Verify that no errors appear in the JS console

Manual tests

Pre-requisite (Skip to Test Steps if testing in/with Staging/Prod):

  1. Ensure you have AZ/Concierge is setup in dev
  2. Checkout, compile, and run https://github.com/Expensify/Auth/pull/22870 in Auth
  3. Checkout and run https://github.com/Expensify/Web-Expensify/pull/54486 in Web-E
  4. Checkout and run [Payment due @huult] Render server-driven AZ status on expense reports #95959 (current branch) in App and login with a test account

Test Steps:

  1. Create or open an expense report that contains at least two expenses with different merchants, for example McDonalds and Starbucks.
  2. Go on the parent multi-expense report, not the individual transaction thread.
  3. Type and and send a concierge request like: 'Update the description for the McDonalds expense to "Lunch with James"'?
  4. Wait a while, then verify the McDonalds expense description is updated to 'Lunch with James'.
  5. Verify Concierge posts a visible acknowledgement in the parent report, for example: I’ve added the description
    “Lunch with James” to the McDonalds expense on this report.

Expected result:

Concierge should emit/show a thinking indicator while the request is in progress. At the end of which, the description update succeeds and the parent multi-expense report receives a visible Concierge acknowledgement.

Issue.651801.-.Manual.Test.mp4

Offline tests

QA Steps

Same as manual test steps above

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

@inimaga inimaga changed the title [Hold Auth#22870][Hold Web-E#54486] Render server-driven AZ status on expense reports Render server-driven AZ status on expense reports Jul 17, 2026
…iven-AZ-status-on-expense-reports

# Conflicts:
#	src/pages/inbox/report/ReportActionsListTailIndicator.tsx
#	tests/unit/ReportActionsListTailIndicatorTest.tsx
@inimaga
inimaga marked this pull request as ready for review July 17, 2026 11:13
@inimaga
inimaga requested review from a team as code owners July 17, 2026 11:13
@melvin-bot
melvin-bot Bot requested a review from huult July 17, 2026 11:13
@melvin-bot

melvin-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

@huult 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]

@melvin-bot
melvin-bot Bot requested review from joekaufmanexpensify and removed request for a team July 17, 2026 11:13

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 056f875ba5

ℹ️ 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".

@huult

huult commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Screen.Recording.2026-07-21.at.15.34.37.mov
Android: mWeb Chrome
Screen.Recording.2026-07-21.at.15.39.27.mov
iOS: HybridApp
Screen.Recording.2026-07-21.at.15.43.42.mov
iOS: mWeb Safari
Screen.Recording.2026-07-21.at.15.52.08.mov
MacOS: Chrome / Safari
Screen.Recording.2026-07-21.at.15.19.32.mov

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

Good for product 👍

@huult

huult commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

@inimaga Could you help set up your local env so I can access it to test this PR?

@inimaga

inimaga commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

@huult You don't need the additional setup. The backend PR is already deployed so you can test directly against staging. In the instructions for manual test above, you can go straight to test steps.

@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

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.

Files with missing lines Coverage Δ
.../MoneyRequestReportView/MoneyRequestReportView.tsx 55.91% <100.00%> (+0.96%) ⬆️
src/pages/inbox/AgentZeroStatusContext.tsx 95.08% <100.00%> (+0.16%) ⬆️
src/pages/inbox/report/ReportActionsList.tsx 83.94% <100.00%> (ø)
...es/inbox/report/ReportActionsListTailIndicator.tsx 100.00% <100.00%> (ø)
...equestReportView/MoneyRequestReportActionsList.tsx 62.67% <43.75%> (-1.36%) ⬇️
... and 32 files with indirect coverage changes

@github-actions

Copy link
Copy Markdown
Contributor

🚧 inimaga has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

This comment has been minimized.

@huult

huult commented Jul 21, 2026

Copy link
Copy Markdown
Contributor
Screen.Recording.2026-07-21.at.12.46.46.mov

Yeah, I can see it. I'll do some more testing and update the checklist.

@huult

huult commented Jul 21, 2026

Copy link
Copy Markdown
Contributor
Screen.Recording.2026-07-21.at.12.58.44.mov

Reproduction Steps

  1. Create a report.

  2. Create 4 expenses:

    • 3 expenses with the description "McDonalds"
    • 1 expense with the description "Starbucks"
  3. Send the message:

    Update the description for the McDonalds expense to "Lunch with James"

  4. Select the "All 3 expenses" option from Concierge.

  5. Verify that the descriptions are updated from "McDonalds" to "Lunch with James".

  6. Send another message:

    Update the description for the McDonalds expense to "Lunch"

Current behavior:
The descriptions are updated from "Lunch with James" to "Lunch", even though there are no longer any expenses with the description "McDonalds".

Expected behavior:
The update should not be applied because no expense with the description "McDonalds" exists anymore.

@inimaga Could you take a look at this issue?

@huult

huult commented Jul 21, 2026

Copy link
Copy Markdown
Contributor
Untitled.2.mov

@inimaga I occasionally encounter this issue. After sending a request, Concierge remains in the "Thinking..." state and never returns a response.

Retrying the same request usually succeeds:

Screen.Recording.2026-07-21.at.13.24.43.mov

@huult

huult commented Jul 21, 2026

Copy link
Copy Markdown
Contributor
Screen.Recording.2026-07-21.at.13.33.13.mov
  1. Create a report with 2 expenses:

    • One expense with the description "McDonalds"
    • One expense with the description "Starbucks"
  2. Send the following message:

    Update the description for the McDonalds expense to "Lunch"

  3. While Concierge is showing "Thinking...", send another message:

    Update the description for the Starbucks expense to "Lunch with James"

Current behavior

After Concierge finishes processing, only the McDonalds expense is updated to "Lunch". The second request is not processed, and Concierge does not post the expected acknowledgement message for it.

Expected behavior

After the first request completes, Concierge should also process the second request (or clearly indicate that it cannot). An acknowledgement message should be posted for each successfully completed request.

@inimaga could you check this issue?

@huult

huult commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

@inimaga Could you take a look at my comment when you have a chance?

@inimaga

inimaga commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

@huult Sorry for the delay here.

Regarding the flagged issues;

For issue 1: Send an initial message to change the description, and a subsequent message referencing the old changed description.

Current behavior:
The descriptions are updated from "Lunch with James" to "Lunch", even though there are no longer any expenses with the description "McDonalds".

Expected behavior:
The update should not be applied because no expense with the description "McDonalds" exists anymore.

The fix for this belongs in the backend. Thanks for flagging. I will create a separate issue to track this. The App PR only renders the status indicator so I want the potential blockers here to only be focused on this.

For issue 2: Occasional stuck thinking state. Looking at the videos you submitted, its not actually stuck in a thinking state (as there is no thinking indicator). But rather, it stopped thinking, but there wasn't an acknowledgment to say what it decided to do. In this particular instance, a simple acknowledgement would have sufficed. To be also fixed in the backend. Will track with a separate issue.

For issue 3: Follow-up request while Concierge is thinking is not processed. This isn't actually limited to this flow and is an issue with Concierge handling multiple requests even in the main flow. When you start a concierge 1-on-1 dm and ask it a question, then while its thinking, ask another question, it'll only answer / action your first question. But overall, I agree this makes for a bad product experience so will make another separate issue to fix across the product (not just this flow).

Overall we shouldn't block on the above 3 issue as they are beyond the scope of this PR. Nevertheless, I will be addressing them separately in follow-ups.

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

LGTM.

@melvin-bot
melvin-bot Bot requested a review from cristipaval July 23, 2026 14:34
@melvin-bot

melvin-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

@cristipaval 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]

@melvin-bot melvin-bot Bot changed the title Render server-driven AZ status on expense reports [Payment due @huult] Render server-driven AZ status on expense reports Jul 23, 2026
@melvin-bot

melvin-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

🎯 @huult, thanks for reviewing and testing this PR! 🎉

A payment issue will be created for your review once this PR is deployed to production.
E/E issue linked to the PR - https://www.github.com/Expensify/Expensify/issues/651801.

If payment is not needed (e.g., regression PR review fix etc), react with 👎 to this comment to prevent the payment issue from being created.

@inimaga

inimaga commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

Trackings for backend follow-up issues created here:

@huult

huult commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Thank you

@cristipaval
cristipaval merged commit 7c23e69 into main Jul 23, 2026
44 of 47 checks passed
@cristipaval
cristipaval deleted the issa/Render-server-driven-AZ-status-on-expense-reports branch July 23, 2026 21:17
@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@github-actions

Copy link
Copy Markdown
Contributor

🚧 cristipaval has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/cristipaval in version: 9.4.44-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

Help site review — no docs changes required

I reviewed the changes in this PR against App/docs/articles and applied the naming/authoring/template guidelines. No help site updates are needed, so I did not open a draft docs PR.

Why: This PR is internal UI plumbing — it lets non-chat (expense) reports mount the AgentZero status gate when the server writes a processing-indicator NVP, so parent multi-expense reports can render the server-driven Concierge "thinking"/status bubble. That indicator is transient, in-product visual feedback; it introduces no new user-facing feature, setting, tab, label, button, or workflow that the help site documents.

The actual user-facing capability this supports — editing/updating an expense by chatting with Concierge on a report — is already documented and accurate in Expense-Assistant.md, including the "Modify expenses → Edit the description" flow and the "In a report chat" context-resolution note. Nothing in that article needs to change for this PR.

If a future PR adds a documented behavior change (e.g., a new Concierge capability, a user-visible setting, or copy the help site references), flag it and I'll draft the docs update then.


@inimaga, please confirm you agree no help site changes are needed here. If you'd still like a docs PR created (or believe an article should call out this behavior), reply with the details and I'll open one.

@melvin-bot

melvin-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown

🤖 Payment issue created: #97137

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/marcaaron in version: 9.4.44-6 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

@quinthar quinthar added the #ai label Aug 11, 2026
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.

7 participants