Skip to content

[$250] Concierge AI - Expense report title created by Concierge AI is in code format #75296

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.2.59-2
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-1993/folder/22315296/56014375/1016708755
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Device used: Windows 11 Home/Chrome
App Component: Money Requests

Action Performed:

Preconditions: Create a fresh test account (email without "+", select manage my team's expense and QBD)

  1. Open https://staging.new.expensify.com/
  2. Navigate to Concierge DM
  3. Send a message “Add an expense for $45 at Home Depot.”
  4. Wait for Concierge finishes thinking
  5. Navigate to LHN
  6. Navigate to Workspace chat

Expected Result:

Expense report title should be updated after created following the report title format

Actual Result:

Expense report title is shown as code

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021991095954756240982
  • Upwork Job ID: 1991095954756240982
  • Last Price Increase: 2025-12-10
Issue OwnerCurrent Issue Owner: @Pujan92

Activity

  1. added
    Daily
    Bug
    on Nov 17, 2025
  2. melvin-bot commented on Nov 17, 2025

    @melvin-bot

    Triggered auto assignment to @dylanexpensify (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. added
    External
    on Nov 19, 2025
  4. melvin-bot commented on Nov 19, 2025

    @melvin-bot
  5. changed the title [-]Concierge AI - Expense report title created by Concierge AI is in code format[/-] [+][$250] Concierge AI - Expense report title created by Concierge AI is in code format[/+] on Nov 19, 2025
  6. added
    Help Wanted
    on Nov 19, 2025
  7. melvin-bot commented on Nov 19, 2025

    @melvin-bot

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

  8. marufsharifi commented on Nov 26, 2025

    @marufsharifi
    Contributor

    Proposal

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

    Concierge-created expense reports show raw formula text ({report:type} {report:startdate}) in the DM preview and LHN row instead of the formatted title (e.g., “Expense Report 2025-11-24”).

    What is the root cause of that problem?

    The root cause is that our report-naming logic never evaluates formula-based titles, so the UI renders the raw formula string that Concierge seeds by default.

    Specifically:

    • getMoneyRequestReportName simply returns report.reportName for expense reports without computing it. When Concierge sets the title to {report:type} {report:startdate}, that exact string is passed through unchanged.

      App/src/libs/ReportUtils.ts

      Lines 4365 to 4368 in 29e1abf

      function getMoneyRequestReportName({report, policy, invoiceReceiverPolicy}: {report: OnyxEntry<Report>; policy?: OnyxEntry<Policy>; invoiceReceiverPolicy?: OnyxEntry<Policy>}): string {
      if (report?.reportName && isExpenseReport(report)) {
      return Str.htmlDecode(report.reportName);
      }
    • The same raw string ({report:type} {report:startdate}) appeared in both the DM preview and the LHN row because both getReportName and getMoneyReportPreviewName resolve expense report titles through getMoneyRequestReportName, which returns the uncomputed formula string.

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

    We should make getMoneyRequestReportName formula-aware so it computes report titles instead of returning the raw {report:type} {report:startdate} string.

    Changes implemented:
    We now compute formula-based titles at read-time instead of returning raw strings.

    Add at the top of getMoneyRequestReportName:

    // Typed shape of the Formula module for dynamic requires.
    type FormulaModule = typeof import('./Formula');
    
    // Detect if a report name or title field string contains any formula parts (e.g., {report:type}).
    function hasFormulaBasedReportName(reportName: string | null | undefined): reportName is string {
        const {parse, FORMULA_PART_TYPES} = require('./Formula') as FormulaModule;
        return !!reportName && typeof reportName === 'string' && parse(reportName).some((part) => part.type !== FORMULA_PART_TYPES.FREETEXT);
    }
    
    // Resolve a report title by evaluating any formula found in the report name or policy title field.
    function computeReportNameFromTitleField(report: OnyxEntry<Report>, policy?: OnyxEntry<Policy>): string {
        const reportNameValuePairs = allReportNameValuePair?.[`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report.reportID}`];
        const titleField = reportNameValuePairs?.expensify_text_title;
        const formulas = [report.reportName, titleField?.value, titleField?.defaultValue].filter(hasFormulaBasedReportName);
    
        if (formulas.length === 0) {
            return '';
        }
    
        const {compute} = require('./Formula') as FormulaModule;
        const sanitizedAllTransactions: Record<string, Transaction> = Object.fromEntries(
            Object.entries(allTransactions ?? {}).flatMap(([key, transaction]) => (transaction ? [[key, transaction]] : [])),
        );
        const context = {report: report as Report, policy: policy ?? allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`], allTransactions: sanitizedAllTransactions};
    
        for (const formula of formulas) {
            const computedName = compute(formula, context)?.trim();
            if (computedName && computedName !== formula) {
                return computedName;
            }
        }
        return '';
    }

    Refine reportName in getMoneyRequestReportName:

    function getMoneyRequestReportName({report, policy, invoiceReceiverPolicy}: {report: OnyxEntry<Report>; policy?: OnyxEntry<Policy>; invoiceReceiverPolicy?: OnyxEntry<Policy>}): string {
    +    const computedReportName = computeReportNameFromTitleField(report, policy);
    +    if (computedReportName) return computedReportName;
    
        // …existing logic (decode reportName, payer/amount strings, etc.)
    }

    Why this fixes the issue:

    • Detects when report.reportName or the policy title field holds a formula (e.g., {report:type} {report:startdate}).
    • Computes it via Formula.compute using the current report/policy/transactions context.
    • Returns the computed string immediately, ensuring Concierge-created reports render as “Expense Report 2025-11-24” in the DM preview and LHN row instead of showing raw placeholders.

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    None

    What alternative solutions did you explore? (Optional)

  9. marufsharifi commented on Nov 26, 2025

    @marufsharifi
    Contributor

    Video demonstrates the proposal resolves the issue.

    main.webm
  10. melvin-bot commented on Nov 26, 2025

    @melvin-bot

    📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

  11. Pujan92 commented on Nov 26, 2025

    @Pujan92
    Contributor

    This seems to a BE issue. It needs to return the correct evaluated report name.

    @dylanexpensify can we assign an internal engineer here?

  12. 7 remaining items

  13. dylanexpensify commented on Dec 11, 2025

    @dylanexpensify
    Contributor

    Updated

  14. added
    Hot Pick
    on Dec 11, 2025
  15. self-assigned this
    on Dec 11, 2025
  16. removed
    Help Wanted
    Hot Pick
    on Dec 11, 2025
  17. ishpaul777 commented on Dec 11, 2025

    @ishpaul777
    Contributor

    I can take this!

  18. ishpaul777 commented on Dec 11, 2025

    @ishpaul777
    Contributor

    Its seems like the issue is not reproducible, can we please retest this @jponikarchuk

    Screen.Recording.2025-12-12.at.4.47.36.AM.mov
  19. jponikarchuk commented on Dec 13, 2025

    @jponikarchuk
    Author

    @ishpaul777 I can't reproduce this issue now

    bandicam.2025-12-13.19-09-41-772.mp4
  20. ishpaul777 commented on Dec 15, 2025

    @ishpaul777
    Contributor

    great! we can close this one as not reproducible @dylanexpensify

  21. melvin-bot commented on Dec 16, 2025

    @melvin-bot

    @Pujan92 Eep! 4 days overdue now. Issues have feelings too...

  22. ishpaul777 commented on Dec 17, 2025

    @ishpaul777
    Contributor

    gentle bump @dylanexpensify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugDailyInternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions