You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Agents - Not here page opens after switching to agent, avatar shows fallback avatar #89852
Version Number: 9.3.68-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:#89547 Email or phone of affected tester (no customers):applausetester+sjdiosn2ddd2d@applause.expensifail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.2 / Chrome App Component: Other
Action Performed:
Precondition:
Log in with Expensifail account.
Go to staging.new.expensify.com
Go to Account > Agents.
Click New agent > Save.
Open account switcher.
Select the agent.
Expected Result:
Not here page will not open after switching to agent.
Avatar will load.
Actual Result:
Not here page opens after switching to agent.
Avatar shows fallback avatar.
👋 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:
Identify the pull request that introduced this issue and revert it.
Classification: Frontend bug Causing PR: #89547 - "feat: [89310] add agents flow" by @NicolasBonet (High confidence) Related Issues: #89310
Recommendation: REVERT
PR #89547 introduced the agent creation flow, but the account switching behavior after creating an agent leads to the "Not here" page and fallback avatar. This is a staging-only issue (new feature, not in production), and the fix requires changes to the App repo.
Assigned: @NicolasBonet (PR author), @puneetlath (approving reviewer) from highest-confidence causing PR only Labels: Removed DeployBlocker (backend label) — this is a frontend bug. DeployBlockerCash retained.
Evidence and Detailed Analysis
Evidence
The melvin-bot comment on the issue explicitly points to #89547 as the responsible PR
The createAgent function writes an optimistic PERSONAL_DETAILS_LIST entry with a negative optimisticAccountID, then clears it on success — leaving the real agent account details dependent on the server response
AgentsPage.tsx renders NotFoundPage when !isCustomAgentEnabled (line 96), meaning if the agent's session doesn't carry the CUSTOM_AGENT beta permission, the "Not here" page is shown immediately upon switching to the agent
The fallback avatar is caused by missing avatar and fallbackIcon fields in the agent's personal details after account switching, since the real personal details for the agent account are not populated on the client after switching
Root Cause
When a user creates an agent via the CreateAgent API and then opens the account switcher to switch to the agent account, two problems occur:
"Not here" page: After switching to the agent account, the app renders the Agents settings page (or navigates to a screen) where isCustomAgentEnabled is evaluated via isBetaEnabled(CONST.BETAS.CUSTOM_AGENT). The agent account session does not carry the CUSTOM_AGENT beta, so the page falls through to the NotFoundPage branch at line 96 of AgentsPage.tsx.
Fallback avatar: The createAgent optimistic data populates PERSONAL_DETAILS_LIST with only accountID, displayName, and isOptimisticPersonalDetail — no avatar field. On success the optimistic entry is cleared, and the app has no avatar URL for the real agent account until personal details are reloaded. The avatar component falls back to the default fallback icon.
Both issues are rooted in the App-side implementation of the agent creation and account-switching flow introduced in PR #89547.
This issue has two independent root causes, both introduced in #89547.
Root Cause 1: "Not here" page after switching to agent
When the account switcher calls Delegate.connect(), it runs clearOnyxForDelegateTransition() which wipes ONYXKEYS.BETAS — but does not reset React Navigation state. The user stays on the Agents settings route. AgentsPage.tsx:95-97 renders <NotFoundPage /> when the customAgent beta is missing. Since the agent account either (a) doesn't have the beta, or (b) betas haven't loaded yet from the openApp() response, the "Hmm... it's not here" page appears.
Recommended Fix: The delegate connect flow should navigate to Home after switching accounts (similar to how sign-in lands on Home), rather than leaving stale navigation state pointing at beta-gated pages the new account may not have access to.
Root Cause 2: Fallback avatar for agent
Bot avatars are defined in DefaultBotAvatars.ts but are never registered in PresetAvatarCatalog.ts, which is the only source of truth for resolving avatar names to local SVGs. Additionally, createAgent() sets optimistic personalDetails with no avatar field, so the avatar is undefined during the optimistic period. Even after the server responds, the bot-avatar URL doesn't match DEFAULT_AVATAR_URL_PATTERNS so it can't resolve to a local SVG, causing the FallbackAvatar to render.
Recommended Fix:
Register bot avatars in PresetAvatarCatalog.ts so the avatar resolution pipeline can map bot-avatar IDs to local SVGs.
Include the avatar in the optimistic personalDetails inside createAgent() so it renders immediately.
Investigation details
"Not here" page flow:
User is on Settings > Agents page (has customAgent beta on main account)
Activity
melvin-bot commentedon May 7, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #89547
melvin-bot commentedon May 7, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon May 7, 2026
👋 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:
OSBotify commentedon May 7, 2026
Investigation Summary
Classification: Frontend bug
Causing PR: #89547 - "feat: [89310] add agents flow" by @NicolasBonet (High confidence)
Related Issues: #89310
Recommendation: REVERT
PR #89547 introduced the agent creation flow, but the account switching behavior after creating an agent leads to the "Not here" page and fallback avatar. This is a staging-only issue (new feature, not in production), and the fix requires changes to the App repo.
Assigned: @NicolasBonet (PR author), @puneetlath (approving reviewer) from highest-confidence causing PR only
Labels: Removed
DeployBlocker(backend label) — this is a frontend bug.DeployBlockerCashretained.Evidence and Detailed Analysis
Evidence
Verification
src/libs/actions/Agent.ts,src/pages/settings/Agents/AgentsPage.tsx,src/pages/settings/Agents/AddAgentPage.tsxWRITE_COMMANDS.CREATE_AGENT)createAgentfunction writes an optimisticPERSONAL_DETAILS_LISTentry with a negativeoptimisticAccountID, then clears it on success — leaving the real agent account details dependent on the server responseAgentsPage.tsxrendersNotFoundPagewhen!isCustomAgentEnabled(line 96), meaning if the agent's session doesn't carry theCUSTOM_AGENTbeta permission, the "Not here" page is shown immediately upon switching to the agentavatarandfallbackIconfields in the agent's personal details after account switching, since the real personal details for the agent account are not populated on the client after switchingRoot Cause
When a user creates an agent via the
CreateAgentAPI and then opens the account switcher to switch to the agent account, two problems occur:"Not here" page: After switching to the agent account, the app renders the Agents settings page (or navigates to a screen) where
isCustomAgentEnabledis evaluated viaisBetaEnabled(CONST.BETAS.CUSTOM_AGENT). The agent account session does not carry theCUSTOM_AGENTbeta, so the page falls through to theNotFoundPagebranch at line 96 ofAgentsPage.tsx.Fallback avatar: The
createAgentoptimistic data populatesPERSONAL_DETAILS_LISTwith onlyaccountID,displayName, andisOptimisticPersonalDetail— noavatarfield. On success the optimistic entry is cleared, and the app has no avatar URL for the real agent account until personal details are reloaded. The avatar component falls back to the default fallback icon.Both issues are rooted in the App-side implementation of the agent creation and account-switching flow introduced in PR #89547.
MelvinBot commentedon May 7, 2026
Issue Analysis
This issue has two independent root causes, both introduced in #89547.
Root Cause 1: "Not here" page after switching to agent
When the account switcher calls
Delegate.connect(), it runsclearOnyxForDelegateTransition()which wipesONYXKEYS.BETAS— but does not reset React Navigation state. The user stays on the Agents settings route.AgentsPage.tsx:95-97renders<NotFoundPage />when thecustomAgentbeta is missing. Since the agent account either (a) doesn't have the beta, or (b) betas haven't loaded yet from theopenApp()response, the "Hmm... it's not here" page appears.Recommended Fix: The delegate connect flow should navigate to Home after switching accounts (similar to how sign-in lands on Home), rather than leaving stale navigation state pointing at beta-gated pages the new account may not have access to.
Root Cause 2: Fallback avatar for agent
Bot avatars are defined in
DefaultBotAvatars.tsbut are never registered inPresetAvatarCatalog.ts, which is the only source of truth for resolving avatar names to local SVGs. Additionally,createAgent()sets optimisticpersonalDetailswith no avatar field, so the avatar isundefinedduring the optimistic period. Even after the server responds, the bot-avatar URL doesn't matchDEFAULT_AVATAR_URL_PATTERNSso it can't resolve to a local SVG, causing theFallbackAvatarto render.Recommended Fix:
PresetAvatarCatalog.tsso the avatar resolution pipeline can map bot-avatar IDs to local SVGs.personalDetailsinsidecreateAgent()so it renders immediately.Investigation details
"Not here" page flow:
customAgentbeta on main account)AccountSwitcher.tsx:204-207callsDelegate.connect()connect()callsclearOnyxForDelegateTransition()→Onyx.clear()wipesBETAS(not in preservation list)AgentsPagere-renders,isBetaEnabled(CONST.BETAS.CUSTOM_AGENT)returnsfalse→<NotFoundPage />Avatar flow:
AddAgentPageextracts bot avatar ID (e.g.,bot-avatar--blue) and sendscustomExpensifyAvatarIDto APIpersonalDetailsentry has noavatarfield →undefined→FallbackAvatarDEFAULT_AVATAR_URL_PATTERNSinUserAvatarUtils.tsPresetAvatarCataloghas no bot avatar entries, so resolution fails →FallbackAvatarpersistsConfidence: High — both root causes are clearly traceable in code.
Next Steps: Reply with
@MelvinBot implement thisto create a draft PR, or@MelvinBot <your feedback>to refine this analysis.puneetlath commentedon May 7, 2026
This is expected for now. The BE for agent creation isn't all on production yet.