Skip to content

[$250] Copilot - Concierge message is displayed with a copilot header for uncategorized expense #80326

Closed

Description

@jponikarchuk

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: v9.3.7-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/test-runs/TR-3292/folder/13176687/41236699/1143583286?sort=%2Bidentifier&p=2
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Windows 11/ Chrome, Android 13
App Component: Other

Action Performed:

Pre-condition:
Main account has added a copilot

  1. Sign in to staging.new.expensify.com with the copilot account
  2. Navigate to account settings > two arrows (to change to the main account)
  3. With the main account opened as the copilot account, navigate to personal conversation (Your space)
  4. Create an expense (track an expense) with the category field empty

Expected Result:

In the conversation the tracked expense is created and a concierge message is displayed to categorize the expense. The message is displayed with "Concierge" as the message header.

Actual Result:

Concierge message is displayed as if it is sent from the copilot account with the copilot header displayed on the message.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022014774958973147602
  • Upwork Job ID: 2014774958973147602
  • Last Price Increase: 2026-01-23
Issue OwnerCurrent Issue Owner: @garrettmknight

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 23, 2026
  2. melvin-bot commented on Jan 23, 2026

    @melvin-bot

    Triggered auto assignment to @garrettmknight (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. daledah commented on Jan 23, 2026

    @daledah
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    When a copilot creates a tracked expense on behalf of the main account in Self DM (Your space), the Concierge actionable whisper message is displayed with the copilot's header instead of "Concierge". The message shows "[copilot email] (as copilot for Concierge)" with "on behalf of Expensify Concierge" text below.

    What is the root cause of that problem?

    The issue is that the ACTIONABLE_TRACK_EXPENSE_WHISPER action is being created or returned with a delegateAccountID field when it shouldn't have one.

    Looking at the rendering code in useReportActionAvatars.ts:

    const delegateAccountID = getDelegateAccountIDFromReportAction(action);
    const delegatePersonalDetails = delegateAccountID ? personalDetails?.[delegateAccountID] : undefined;
    const actorAccountID = getReportActionActorAccountID(action, iouReport, chatReport, delegatePersonalDetails);

    And in ReportActionItemSingle.tsx:

    When delegateAccountID is present on the action, the UI:

    1. Uses the delegate's personal details for the avatar/header
    2. Shows "on behalf of..." text

    The buildOptimisticActionableTrackExpenseWhisper function in ReportUtils.ts does NOT set delegateAccountID, but when the server processes the request with a copilot (delegate) context, it likely adds delegateAccountID to all report actions created during that session.

    What changes do you think we should make in order to solve the problem?

    The ACTIONABLE_TRACK_EXPENSE_WHISPER action should NEVER have a delegateAccountID because it's always from Concierge, not from the user/copilot who triggered it.

    Update buildOptimisticActionableTrackExpenseWhisper to explicitly set delegateAccountID: undefined to ensure it's not inherited or added:

    App/src/libs/ReportUtils.ts

    Lines 7654 to 7686 in c9e36d3

    };
    }
    /**
    * Builds an optimistic modified expense action with a randomly generated reportActionID.
    */
    function buildOptimisticModifiedExpenseReportAction(
    transactionThread: OnyxInputOrEntry<Report>,
    oldTransaction: OnyxInputOrEntry<Transaction>,
    transactionChanges: TransactionChanges,
    isFromExpenseReport: boolean,
    policy: OnyxInputOrEntry<Policy>,
    updatedTransaction?: OnyxInputOrEntry<Transaction>,
    allowNegative = false,
    ): OptimisticModifiedExpenseReportAction {
    const originalMessage = getModifiedExpenseOriginalMessage(oldTransaction, transactionChanges, isFromExpenseReport, policy, updatedTransaction, allowNegative);
    const delegateAccountDetails = getPersonalDetailByEmail(delegateEmail);
    return {
    actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE,
    actorAccountID: currentUserAccountID,
    automatic: false,
    avatar: getCurrentUserAvatar(),
    created: DateUtils.getDBTime(),
    isAttachmentOnly: false,
    message: [
    {
    // Currently we are composing the message from the originalMessage and message is only used in OldDot and not in the App
    text: 'You',
    style: 'strong',
    type: CONST.REPORT.MESSAGE.TYPE.TEXT,
    },
    ],

     function buildOptimisticActionableTrackExpenseWhisper(iouAction: OptimisticIOUReportAction, transactionID: string): ReportAction {
         ...
         return {
             actionName: CONST.REPORT.ACTIONS.TYPE.ACTIONABLE_TRACK_EXPENSE_WHISPER,
             actorAccountID,
             avatar: getDefaultAvatarURL({accountID: actorAccountID, accountEmail: targetEmail}),
    +        delegateAccountID: undefined,  // Concierge messages should never show delegate info
             created: DateUtils.addMillisecondsFromDateTime(currentTime, 1),
             ...
         };
     }

    What alternative solutions did you explore? (Optional)

    Update getDelegateAccountIDFromReportAction or the rendering components to explicitly ignore delegateAccountID for ACTIONABLE_TRACK_EXPENSE_WHISPER actions:

    In ReportActionItemSingle.tsx:

    +import {isActionableTrackExpense} from '@libs/ReportActionsUtils';
     ...
    -const delegateAccountID = getDelegateAccountIDFromReportAction(action);
    +// Don't show delegate info for Concierge actionable whisper messages
    +const delegateAccountID = isActionableTrackExpense(action) ? undefined : getDelegateAccountIDFromReportAction(action);

    There might also be a server-side fix needed to ensure the server doesn't add delegateAccountID to ACTIONABLE_TRACK_EXPENSE_WHISPER actions.

  4. nkdengineer commented on Jan 23, 2026

    @nkdengineer
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Concierge message is displayed as if it is sent from the copilot account with the copilot header displayed on the message.

    What is the root cause of that problem?

    The backend returns the delegateAccountID for ACTIONABLE_TRACK_EXPENSE_WHISPER action, then the copilot user is displayed in the avatar of the action

    function getDelegateAccountIDFromReportAction(reportAction: OnyxInputOrEntry<ReportAction>): number | undefined {

    const delegateAccountID = getDelegateAccountIDFromReportAction(action);

    What changes do you think we should make in order to solve the problem?

    We should return the delegateAccountID as undefined if the actorAccountID is the concierge

    if (!reportAction || reportAction?.actorAccountID === CONST.ACCOUNT_ID.CONCIERGE) {
            return undefined;
        }
    

    function getDelegateAccountIDFromReportAction(reportAction: OnyxInputOrEntry<ReportAction>): number | undefined {

    What alternative solutions did you explore? (Optional)

    We can return undefined based on the action type. Will return undefined if the action is a system message action.

    function getDelegateAccountIDFromReportAction(reportAction: OnyxInputOrEntry<ReportAction>): number | undefined {

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jan 23, 2026
  6. changed the title [-]Copilot - Concierge message is displayed with a copilot header for uncategorized expense[/-] [+][$250] Copilot - Concierge message is displayed with a copilot header for uncategorized expense[/+] on Jan 23, 2026
  7. melvin-bot commented on Jan 23, 2026

    @melvin-bot
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 23, 2026
  9. melvin-bot commented on Jan 23, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @suneox (External)

  10. suneox commented on Jan 25, 2026

    @suneox
    Contributor

    @nkdengineer proposal LGTM

    🎀 👀 🎀 C+ reviewed

  11. melvin-bot commented on Jan 25, 2026

    @melvin-bot

    Triggered auto assignment to @jasperhuangg, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

  12. 9 remaining items

  13. melvin-bot commented on Feb 20, 2026

    @melvin-bot

    This issue has not been updated in over 15 days. @garrettmknight, @suneox, @jasperhuangg, @nkdengineer eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  14. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed
    ReviewingHas a PR in review
    on Feb 20, 2026
  15. garrettmknight commented on Feb 20, 2026

    @garrettmknight
    Contributor

    Payment Summary

  16. trjExpensify commented on Feb 25, 2026

    @trjExpensify
    Contributor

    approved $250 for @suneox.

  17. twisterdotcom commented on Feb 25, 2026

    @twisterdotcom
    Contributor

    @nkdengineer has submitted payment for this report on ND here.

    SO: https://stackoverflowteams.com/c/expensify/questions/7582

    Zapier Logs Run ID: 00040eee-e942-a6bd-bfaa-67bc05e82fe4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions