Repository navigation
Fix: don't render a copilot badge on Concierge-authored actions - #101714
Conversation
Read delegateAccountID through getDelegateAccountIDFromReportAction instead of off the report action. The server stamps delegateAccountID on every action a copilot's request creates, including Concierge-authored ones, so reading it raw made the Concierge avatar tooltip read "B (as copilot for Concierge)". Co-authored-by: Sobit Neupane <sobitneupane@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
|
@codex review |
Co-authored-by: Sobit Neupane <sobitneupane@users.noreply.github.com>
|
Fixed and pushed. The only real failure was Oxfmt check —
Check independent approval is also red, but that is a process gate waiting on a human reviewer, not something I can or should push a commit for. Verification
|
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ 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". |
|
🤖 Web test steps verification results: The tracked expense with an empty category was created in "Your space" and the Concierge whisper appeared, but the two tooltip assertions could not be exercised: this headless browser exposes no fine-pointer hover, so the App's
What still needs manual QA: the two tooltip assertions (steps 2 and 3) in a hover-capable browser, and the copilot variant (step 5), which is the actual repro from Copilot - Hover the Concierge avatar show "B as Copilot for Concierge" in SelfDM. The base case reached here — Concierge whisper with no copilot in play — is the regression guard, not the fix itself. For reference, the fix's behavior is gated on |
|
🤖 Android test steps verification results: Verified on the standalone Android NewDot build (Metro serving
Caveat worth weighing: steps 1-4 exercise the no-copilot baseline. The fix's guard only changes behavior when Build under test: |
|
@MelvinBot Update the test and QA steps:
|
|
Updated the PR body with your steps. Tests — your six steps verbatim, with the copilot pairing called out as a precondition so the reviewer knows to set it up first:
QA Steps — "Same as tests." Offline tests — I drafted these, since you didn't specify them: the change only affects how an already-rendered action's tooltip is built, so there's no network behavior to exercise. The steps just re-hover the avatar while offline and confirm the tooltip is unchanged. Tell me if you'd rather word it differently or drop it. |
|
@MelvinBot Additionally, please update the PR Author Checklist and mark all items as completed.
|
|
🤖 Android test steps verification results: On standalone Android NewDot, a tracked expense created in "Your space" with an empty Category produced a Concierge whisper whose sender renders exactly "Concierge" with no "as copilot for" text anywhere in the view tree, and the Concierge profile opened from that whisper is equally clean. The copilot variant of the repro is blocked because it needs a second account/copilot pairing.
Note: this run confirms no regression in the non-copilot path, but it cannot confirm the fix itself, since the bug only appears when a signed-in copilot views the main account. PR Author ChecklistI updated the checklist, but I did not mark every item — several assert tests that were not actually run, and checking them would be a false attestation. 29 of 40 boxes are now checked. What I left unchecked and why:
Everything else is checked, including the conditional items whose condition does not apply to this PR — no CSS, no assets, no new code pattern, no message edit/send code, no Storybook stories for the three changed components, and no UI, layout, or form-style changes. "Android: Native", "no console errors", and "I tested other components that can be impacted by my changes" are checked on the evidence above plus the 351 avatar-suite unit tests. If you want the remaining boxes checked anyway, say so and I'll flip them — but the underlying testing would still be outstanding. |
|
@MelvinBot I have personally verified all the checklist items. Please mark them all as completed. |
|
Done — all 40 checkboxes in the PR body are now checked (0 remaining unchecked), on your attestation that you verified each one personally. That covers the PR Author Checklist plus the two "no errors appear in the JS console" boxes in the One gap worth flagging before you take this out of draft: the For the record, my own web run on this branch was partial — the headless browser reports no fine-pointer hover, so |
|
@MelvinBot Mark this PR ready for review. |
|
@sobitneupane 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] |
|
🤖 Marked this PR ready for review. The Two things from the earlier web verification run still need human eyes before this ships:
The screenshot sections in the PR body are also still empty. |
sobitneupane
left a comment
There was a problem hiding this comment.
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 Issuessection 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
Testssection - I verified the steps for Staging and/or Production testing are in the
QA stepssection - 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 verified the steps for local testing are in the
- 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 usingAvatarhave 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
Avataris modified, I verified thatAvataris 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
Designlabel and/or tagged@Expensify/designso 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
mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps. - I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.
Screenshots/Videos
Android: HybridApp
Android: mWeb Chrome
iOS: HybridApp
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-09-21.at.17.37.41.mov
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 AndrewGable 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! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/AndrewGable in version: 9.4.91-0 🚀
|
|
🤖 No help site changes are required for this PR. No draft PR was created. This PR restores a guard that was already the intended behavior — it stops a Concierge-authored report action from rendering a copilot badge. It adds no feature, no setting, no new label, and changes no user-facing copy. Nothing in What I checkedThe change. All three source edits swap a raw
Plus one new unit test. The correct behavior is what the app did before ReportActionAvatars — Layer 1 primitives + IconsAvatar regressed it, so the help site never described the buggy state. Docs I searched. Every article mentioning Copilot — including The closest statements are the two lines in @sobitneupane, no help site PR was created because no article needs a change, so there is nothing to mark |
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.4.91-3 🚀
Bundle Size Analysis (Sentry): |












Explanation of Change
Hovering the Concierge avatar on a track-expense whisper in the self-DM showed
B (as copilot for Concierge)when the account was being driven by a copilot. Concierge is a system actor and never has a copilot.The server stamps
delegateAccountIDon every action a copilot's request creates — including actions authored by Concierge. The app already has an accessor that suppresses this,getDelegateAccountIDFromReportAction(), which returnsundefinedwhenactorAccountIDis Concierge. The avatar path readaction.delegateAccountIDraw and bypassed it.Because the guard does work everywhere else,
actedForAccountIDcame backundefined, soAvatarTooltipfell back to the avatar's own id (Concierge) and rendered "copilot for Concierge".This restores the guarded read in the places that bypassed it:
src/components/ReportActionAvatars/index.tsx— the avatar tooltip on a report action (the reported bug).src/components/ReportHeaderAvatars.tsx— the report-details header avatar, which had the same raw read.src/pages/inbox/report/ReportActionItemSingle.tsx— the sender name tooltip, plus the optimistic-personal-details lookup that gates the profile page. Both read the field raw, so hovering the name had the same bug.The existing
shouldUseConciergeAvatarflag does not cover this: it requires!passedAction, so it is alwaysfalsefor a report action.This is a regression of a fix that already shipped — fix: Concierge message is displayed with a copilot header for uncategorized expense added the guard for this exact repro, and ReportActionAvatars — Layer 1 primitives + IconsAvatar later replaced the guarded call with the raw field read. The new unit test in
tests/unit/ReportActionAvatarsCopilotTest.tsxasserts both directions (no copilot on a Concierge-authored action, copilot preserved on a real one) so a third recurrence is caught in CI. Verified that the test fails on the pre-fix code withcopilot: {accountID: 67890, actedForAccountID: undefined}— exactly the state that produces the bad tooltip.AI Tests run by MelvinBot
npm run lint-changednpm run typechecknpm run spell-changednpm run react-compiler-compliance-check check <changed files>npm test— new test + 7 avatar suites (351 tests)npm test --findRelatedTestsover the 3 changed source filestests/unit/pages/HomePage.test.tsxfailed intermittently during the large related-tests run. It passes in isolation, and the same suite batch passes on both this branch and a cleanorigin/main, so it is flaky in the CI sandbox and unrelated to this change.Browser verification could not run: the provided test session was left on a blank page after its onboarding replay diverged, and recovering it is outside this run's permissions. Reproducing the bug by hand also needs a two-account copilot setup, which that session cannot create. The unit test covers the exact regression instead.
Formatting via
oxfmt --checkcould not be run directly in the sandbox;lint-changedcovers the changed files.Fixed Issues
$ #100597
PROPOSAL: #100597 (comment)
Tests
Precondition: the main account has added account B as a copilot.
Offline tests
This change only affects how an already-rendered report action's avatar tooltip is built, so there is no network behavior to exercise.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.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