Skip to content

[$250] Agent - Account page is displayed blank on background when user copilots into agent from RHP #97843

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: 9.4.50-0
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #95631
Email or phone of affected tester (no customers): ibellicotest+2766@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Windows 11 / Chrome
App Component: User Settings

Action Performed:

  1. Open the staging.new.expensify.com website.
  2. Navigate to "Account" > "Agent" > Create a new agent.
  3. Note that when RHP is opened, new created agent is visible on background.
  4. Click on RHP header > "Copilot into account"
  5. Note that now a blank space is displayed on background instead of "Profile" page.
  6. Close RHP.
  7. Note that now, "Profile" page appears.

Expected Result:

Content on background should still be visible after user copilots into agent´s account from RHP.

Actual Result:

Blank space is displayed on background instead of "Profile" page, after user copilots into agent´s account from chat RHP.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7225998_1785883689512.Agent_RHP.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7225998

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @mjasikowski

Activity

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

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #95631

  3. applause-bot commented on Aug 5, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/5b406ea95803e531ec43863db230bed9c039839083eece2464f43b66efb4ac7a

  4. melvin-bot commented on Aug 5, 2026

    @melvin-bot

    @chuckdries @eVoloshchak you have been assigned to this deploy blocker because you reviewed the offending PR: #95631

  5. melvin-bot commented on Aug 5, 2026

    @melvin-bot

    @mjasikowski you have been assigned to this deploy blocker because you authored the offending PR: #95631

  6. melvin-bot commented on Aug 5, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  7. github-actions commented on Aug 5, 2026

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  8. MelvinBot commented on Aug 5, 2026

    @MelvinBot
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #95631 - "Open the agent DM via an optimistic reportID" by @mjasikowski (High confidence it enables the reported repro; the underlying guard gap is pre-existing)
    Related Issues: #94395 (the feature request #95631 implemented)

    Recommendation: REVERT

    Reverting #95631 removes the newly added "open the agent DM in an RHP after creation" flow, which is the only path that lets a user reach Copilot into account from an unguarded RHP sitting over the guarded Agents pane — the precondition for the blank background. It is the only new agent code in this deploy (checklist #97828) and reverting cleanly clears the blocker. A targeted roll-forward fix is also viable (see Root Cause) and would be the better long-term path, but revert is the safe action to unblock the deploy now.

    Assigned: @mjasikowski (PR author), @chuckdries and @eVoloshchak (approving reviewers) — already auto-assigned by Melvin, no change needed.
    Labels: No change. DeployBlockerCash is kept (frontend bug, App PR involved). No DeployBlocker (web) label is present, so nothing to remove.

    📋 Detailed Analysis

    Evidence

    • The repro is only reachable through the flow Open the agent DM via an optimistic reportID #95631 introduced: after creating an agent on a wide layout, the app now opens the owner↔agent DM in a dedicated RHP (AGENT_REPORT) over the Agents settings pane, and the agent's name in that RHP header opens the agent Profile which exposes Copilot into account.
    • Open the agent DM via an optimistic reportID #95631 is the only agent-related PR in the current StagingDeployCash checklist (Deploy Checklist: New Expensify 2026-08-04 #97828, item 24).
    • Reproducible on staging only — the entire Agents feature is not in production yet, so N/A in prod is expected and does not weaken the frontend classification.
    • Tapping Copilot into account calls switchToDelegator → connect (delegate), which swaps the session email to the agent. The bug then surfaces on the background pane, not on the API call.

    Verification

    Root Cause

    withAgentAccessDenied performs its actual redirect (to Profile) inside a useFocusEffect, and renders null whenever shouldRedirect is true. On a wide/split layout the guarded Agents pane is the central pane and stays mounted but unfocused while the agent DM lives in the RHP.

    When the owner taps Copilot into account from that RHP:

    1. Session email becomes the agent's, so isAgent flips true and the guarded Agents pane's shouldRedirect becomes true → it renders null = blank background.
    2. The redirect that would push Profile lives in useFocusEffect, which does not fire because the pane isn't focused (the RHP holds focus).
    3. Closing the RHP returns focus to the Agents pane → useFocusEffect finally runs → redirects to Profile → "Profile page appears."

    The designed path (copilot from the guarded EditAgentPage RHP) works because that focused RHP is guarded and its own effect dismisses the modal then redirects (see the comments at withAgentAccessDenied.tsx#L51-L60). #95631 added a path where copilot is triggered from an unguarded report RHP over the guarded pane, which the guard doesn't cover.

    Targeted roll-forward alternative (if the team prefers not to revert): dismiss the agent-DM RHP as part of the copilot switch, or make withAgentAccessDenied redirect the guarded central pane even while it is mounted-but-unfocused (drive the redirect off the isAgent state transition rather than solely off focus).

  9. 32 remaining items

  10. mallenexpensify commented on Aug 27, 2026

    @mallenexpensify
    Contributor

    Please comment and tag me if/when payment is due, thx

  11. NEXAITECHAU commented on Aug 30, 2026

    @NEXAITECHAU
  12. melvin-bot commented on Aug 30, 2026

    @melvin-bot
  13. melvin-bot commented on Aug 31, 2026

    @melvin-bot

    @chuckdries, @mjasikowski, @eVoloshchak Whoops! This issue is 2 days overdue. Let's get this updated quick!

  14. melvin-bot commented on Oct 2, 2026

    @melvin-bot

    This issue has not been updated in over 15 days. @chuckdries, @mjasikowski, @eVoloshchak 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!

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.EngineeringMonthlyKSv2ReviewingHas a PR in review

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions