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
[Due for payment 2026-06-23] [$250] Add confirmation modal after creating your first AI rule (when an agent is created) #93448
When a user creates their first AI rule, RuleBot silently creates an agent and adds it as an admin to their workspace. There's no clear explanation of what just happened, which is confusing.
Solution
Show a confirmation modal after a user creates their first AI rule (i.e., when an agent is created on their behalf) with the following content:
RuleBot has been added to your workspace
To enforce your agent rules, we've created an agent for you and added it as an admin to your workspace.
Edit your agent's details in Account > Agents
( Got it )
Context
This came out of feedback that the experience of creating a first AI rule doesn't explain that an agent is being created and added as a workspace admin. A modal makes this transparent.
Please re-state the problem that we are trying to solve in this issue.
When a user adds their first AI rule, the backend silently creates a "RuleBot" agent and adds it as an admin to the workspace. Nothing in the UI explains this, so the side effect is confusing. We want a one-time confirmation modal explaining what happened.
What is the root cause of that problem?
This is a missing-UX gap, not a bug. The agent is created server-side as a side effect of the ADD_POLICY_AI_RULE command — the frontend saveRule handler just fires the action and immediately navigates back, with no acknowledgement that an agent was created:
What changes do you think we should make in order to solve the problem?
This is frontend-only in Expensify/App — no backend change needed, since the agent is already created server-side and we only need to surface a message.
In AddAIRulePage.tsx, detect whether this is the first rule before submitting, using the same isEmptyObject check the section already uses (AIRulesSection.tsx:34-35):
constpolicy=usePolicy(policyID);const[showAgentCreatedModal,setShowAgentCreatedModal]=useState(false);constsaveRule=(values)=>{constisFirstRule=isEmptyObject(policy?.rules?.aiRules);addPolicyAIRule(policyID,rand64(),values[INPUT_IDS.PROMPT]);if(isFirstRule){setShowAgentCreatedModal(true);// navigate back on confirm}else{Navigation.goBack();}};
Render a ConfirmModal with a single "Got it" action (shouldShowCancelButton={false}) that calls Navigation.goBack() on confirm/close. Title: "RuleBot has been added to your workspace"; prompt: the body copy from the mockup; confirm text: "Got it".
Add the new strings to the workspace.rules.aiRules block in en.ts:7505-7517 and translate across the other src/languages/*.ts files.
Design considerations
"First rule" detection: checking isEmptyObject(policy?.rules?.aiRules) at submit time is reliable because the optimistic update for the new rule hasn't been applied yet when saveRule runs. Alternatively !policy?.ruleBotAccountID could be used, but ruleBotAccountID is only set after the server responds, so it's not safe for the optimistic flow.
Offline: the modal is purely informational and triggers optimistically, so it works offline. The agent is still created server-side once the queued request flushes.
Edge case: if a user deletes all rules and adds another, aiRules would be empty again and the modal would re-show. Confirm with design whether that's acceptable, or gate on ruleBotAccountID already existing to make it strictly once-per-workspace.
What alternative solutions did you explore?
Showing the modal on PolicyRulesPage/AIRulesSection after navigating back (e.g., watching ruleBotAccountID transition from unset → set). This is more "correct" (fires only when the agent truly exists) but adds cross-page state and a watcher; the in-page approach is simpler and matches the mockup's flow.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/93448) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
changed the title [-]Add confirmation modal after creating your first AI rule (when an agent is created)[/-][+][$250] Add confirmation modal after creating your first AI rule (when an agent is created)[/+]on Jun 15, 2026
@MelvinBot payment is due on this issue. Review the above regressions/deploy blockers related to the PR for this issue to determine how much is due. Return a bulleted list of offending PRs and mention if their associated/linked GH issue was paid. Payment details are in https://github.com/Expensify/App/blob/main/contributingGuides/CONTRIBUTING.md. include proposed payment details in the below format
Payment Summary
Contributor: @user paid $250 via Upwork
Contributor+: @user due $250 via NewDot
If there are posts on the PR or issue that reference a regression or deploy blocker, C+ posts on the issue and confirms regression (which will reduce pay by 50%) or provides reasoning why they shouldn’t be considered. If the C+ doesn’t update the issue, the contributor manager making the payment will assume any mention of a regression or deploy blockers reduces the issue amount.
Reviewed the deploy blockers linked to PR #93466 (the PR for this issue) against the regression policy — a 50% penalty per regression applies to the Contributor and Contributor+.
Offending PR:#93466 (this issue's PR). Three deploy blockers were auto-linked to it; only one is a true regression caused by it:
Agents - Agent is not created when confirm page shows RuleBot has been added to your workspace #93624 — "Agent is not created when confirm page shows RuleBot has been added" → ❌ Not a regression from this PR.Analysis determined it's a pre-existing backend gap in the ADD_POLICY_AGENT_RULE command (agent not re-created after manual deletion); this PR only made it visible. No penalty. Not yet paid (internal backend fix in progress, no contributor job).
Net: 1 regression → Contributor+ payment reduced by 50%.
Payment Summary
Contributor: NicolasBonet — no payment (internal Expensify engineer; PR was MelvinBot-authored)
Contributor+: @aimane-chnaif due $125 via Upwork ($250 base − 50% regression penalty for #93618)
One decision left for you, mallenexpensify:QichenZhu did the initial review and requested changes before aimane-chnaiftook over and approved. The handoff was to expedite the merge before NicolasBonet went OOO (confirmed here). Only one C+ is normally paid per issue, so whether QichenZhu gets a separate/split review payment is your call — the summary above assumes the single C+ of record (aimane-chnaif).
Yeah, I had commented in the other PR that I thought that after you make the rule, the RHP should be closed in the background while the new agent modal is shown. So I do think this is a bug. If you navigate to Account > Agents from the modal, and then go back, you should just go back and see your newly created rule at the bottom of the Rules page - not the edit RHP.
I'm going to let it slide cuz of what you posted here before a C+ was assigned and you fixed the bug.
I am not sure why this is bug. This is native behavior of browser history.
I also tested this browser back button flow during PR review but not reported.
$75 because tests weren't completed @QichenZhu (and that's a lot of the value in reviews).
@mallenexpensify would you let it slide for me as well? We have a rule that even a PR review where testing isn't involved is worth $125, and I actually tested the PR and filled 3/4 of the checklist, just didn't finish it at the time because it didn't pass my testing.
@QichenZhu the difference is, when a PR is paid $125 cuz testing isn't needed, every other part of the process is completed. For your instance, tests weren't completed and the PR wouldn't have be merge-able had another C+ not stepped in (who we ended up paying the full price to)
For your instance, tests weren't completed and the PR wouldn't have be merge-able had another C+ not stepped in (who we ended up paying the full price to)
It was just because the PR was ready for retesting during my night off. I would have picked it up the next day otherwise.
the difference is, when a PR is paid $125 cuz testing isn't needed, every other part of the process is completed.
I completed the impactful part, and the other parts wouldn't have changed the outcome.
What I did
Testing is a lot of the value as you noted, and I did it on two platforms and attached screenshots.
Activity
puneetlath commentedon Jun 12, 2026
Mockup from @shawnborton
puneetlath commentedon Jun 12, 2026
@MelvinBot investigate this.
MelvinBot commentedon Jun 12, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user adds their first AI rule, the backend silently creates a "RuleBot" agent and adds it as an admin to the workspace. Nothing in the UI explains this, so the side effect is confusing. We want a one-time confirmation modal explaining what happened.
What is the root cause of that problem?
This is a missing-UX gap, not a bug. The agent is created server-side as a side effect of the
ADD_POLICY_AI_RULEcommand — the frontendsaveRulehandler just fires the action and immediately navigates back, with no acknowledgement that an agent was created:Code references
AddAIRulePage.tsx:56-59Policy/Rules.ts:329-397ruleBotAccountID:Policy.ts:2283-2284policy.rules.aiRules:Policy.ts:2279-2280What changes do you think we should make in order to solve the problem?
This is frontend-only in
Expensify/App— no backend change needed, since the agent is already created server-side and we only need to surface a message.AddAIRulePage.tsx, detect whether this is the first rule before submitting, using the sameisEmptyObjectcheck the section already uses (AIRulesSection.tsx:34-35):ConfirmModalwith a single "Got it" action (shouldShowCancelButton={false}) that callsNavigation.goBack()on confirm/close. Title: "RuleBot has been added to your workspace"; prompt: the body copy from the mockup; confirm text: "Got it".workspace.rules.aiRulesblock inen.ts:7505-7517and translate across the othersrc/languages/*.tsfiles.Design considerations
isEmptyObject(policy?.rules?.aiRules)at submit time is reliable because the optimistic update for the new rule hasn't been applied yet whensaveRuleruns. Alternatively!policy?.ruleBotAccountIDcould be used, butruleBotAccountIDis only set after the server responds, so it's not safe for the optimistic flow.aiRuleswould be empty again and the modal would re-show. Confirm with design whether that's acceptable, or gate onruleBotAccountIDalready existing to make it strictly once-per-workspace.What alternative solutions did you explore?
Showing the modal on
PolicyRulesPage/AIRulesSectionafter navigating back (e.g., watchingruleBotAccountIDtransition from unset → set). This is more "correct" (fires only when the agent truly exists) but adds cross-page state and a watcher; the in-page approach is simpler and matches the mockup's flow.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/93448)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
NicolasBonet commentedon Jun 12, 2026
@MelvinBot let's implement this
MelvinBot commentedon Jun 12, 2026
🤖 Draft PR created: #93466
Please mark it as "Ready for review" when it is ready for review.
[-]Add confirmation modal after creating your first AI rule (when an agent is created)[/-][+][$250] Add confirmation modal after creating your first AI rule (when an agent is created)[/+]27 remaining items
mallenexpensify commentedon Jun 26, 2026
@MelvinBot payment is due on this issue. Review the above regressions/deploy blockers related to the PR for this issue to determine how much is due. Return a bulleted list of offending PRs and mention if their associated/linked GH issue was paid. Payment details are in https://github.com/Expensify/App/blob/main/contributingGuides/CONTRIBUTING.md. include proposed payment details in the below format
mallenexpensify commentedon Jun 26, 2026
@aimane-chnaif once Melv is finished above, please comment on DBs. From the C+ doc
MelvinBot commentedon Jun 26, 2026
Reviewed the deploy blockers linked to PR #93466 (the PR for this issue) against the regression policy — a 50% penalty per regression applies to the Contributor and Contributor+.
Offending PR: #93466 (this issue's PR). Three deploy blockers were auto-linked to it; only one is a true regression caused by it:
[$250]job (Due for payment 2026-06-24), reviewed there byaimane-chnaifvia auto-offer — paid separately on that issue, not here.ADD_POLICY_AGENT_RULEcommand (agent not re-created after manual deletion); this PR only made it visible. No penalty. Not yet paid (internal backend fix in progress, no contributor job).Net: 1 regression → Contributor+ payment reduced by 50%.
One decision left for you,
mallenexpensify:QichenZhudid the initial review and requested changes beforeaimane-chnaiftook over and approved. The handoff was to expedite the merge beforeNicolasBonetwent OOO (confirmed here). Only one C+ is normally paid per issue, so whetherQichenZhugets a separate/split review payment is your call — the summary above assumes the single C+ of record (aimane-chnaif).aimane-chnaif commentedon Jun 26, 2026
I'd say #93618 is a follow-up of new feature, not regression which broke production behavior.
Reasoning: #93618 (comment)
Also assigned engineer suspected if it's an issue.
The rest 2 are unrelated as Melvin said.
And the follow-up PR was also reviewed by me and there's no extra payment as I suggested.
mallenexpensify commentedon Jun 26, 2026
@aimane-chnaif this one feels on the line cuz Shawn posted here
I'm going to let it slide cuz of what you posted here before a C+ was assigned and you fixed the bug.
mallenexpensify commentedon Jun 26, 2026
Payment Summary
Contributor+: @QichenZhu due $125 via NewDot
Contributor+: @aimane-chnaif due $250 via NewDot
$75 because tests weren't completed @QichenZhu (and that's a lot of the value in reviews).QichenZhu commentedon Jun 26, 2026
@mallenexpensify would you let it slide for me as well? We have a rule that even a PR review where testing isn't involved is worth $125, and I actually tested the PR and filled 3/4 of the checklist, just didn't finish it at the time because it didn't pass my testing.
mallenexpensify commentedon Jun 27, 2026
@QichenZhu the difference is, when a PR is paid $125 cuz testing isn't needed, every other part of the process is completed. For your instance, tests weren't completed and the PR wouldn't have be merge-able had another C+ not stepped in (who we ended up paying the full price to)
QichenZhu commentedon Jun 29, 2026
@mallenexpensify thanks for clarifying!
It was just because the PR was ready for retesting during my night off. I would have picked it up the next day otherwise.
I completed the impactful part, and the other parts wouldn't have changed the outcome.
What I did
All the changes in the PR happened during this phase.
What I didn't get to
I'd argue I should get the full payment here.
mallenexpensify commentedon Jun 30, 2026
@QichenZhu bumped price to $125, mainly cuz testing was completed, just not full testing. thx for the breakdown.
QichenZhu commentedon Jul 3, 2026
Glad we found a middle ground!
trjExpensify commentedon Jul 6, 2026
approved $125 for @QichenZhu
garrettmknight commentedon Jul 19, 2026
$250 apprvoed for @aimane-chnaif