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
[$175] – PR 103367 – Concierge – Custom Agent Replies When @Concierge Is Mentioned #104425
Version Number: v9.5.14-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#103367 Email or phone of affected tester (no customers):sintayewhaylu01@gmail.com Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Windows 10 /Chrome App Component: Other
Action Performed:
Navigate to staging.new.expensify.com.
Go to Account → Agents → New Agent → Build Custom Agent.
Open an expense report containing two or more expenses
Send the following message in the report's comments: @concierge what is this report's total?
Expected Result:
Only Concierge's reply should be displayed.
Actual Result:
Both Concierge's reply and the custom agent's reply are displayed.
Root Cause: This appears to be a backend/internal issue. A separate internal investigation is needed.
The App never tells the server which agent should reply. The server reads the comment and decides that on its own. PR 103367 did not cause the extra reply. It only adds the 👍/👎 prompt, which makes the agent's reply easier to notice.
Recommended Fix: The fix is outside the App repo. Please escalate to an internal engineer who can change how the backend picks which agents reply.
Investigation details
AddComment sends only the report ID, the comment HTML and Concierge-specific fields. It sends no mentioned accounts and no agent IDs: src/libs/API/parameters/AddCommentOrAttachmentParams.ts:3-21. The @Concierge mention exists only inside the comment HTML.
PR 103367's getFeedbackPromptActionIDs only chooses which comments get the feedback prompt. The PR doesn't change any visibility or filtering logic, so the agent's reply would have shown before the PR too, just without the prompt. The report says the bug also reproduces in production.
Possible confounder: steps 5-6 of PR 103367's test plan have the tester @-mention the agent in the same expense report. If the agent was mentioned there earlier, it may have joined the report and now replies to every comment. Please check the video to confirm whether the agent was mentioned before.
I could not test this on web. Reproducing it needs backend agent replies, and I couldn't read the backend code.
Next Steps: Reply with @MelvinBot <your feedback> to refine this analysis.
changed the title [-]– PR 103367 – Concierge – Custom Agent Replies When @Concierge Is Mentioned[/-][+][$175] – PR 103367 – Concierge – Custom Agent Replies When @Concierge Is Mentioned[/+]on Oct 19, 2026
Please re-state the problem that we are trying to solve in this issue.
When sending a message mentioning @Concierge (e.g. @Concierge what is this report's total?) in an expense report where a custom agent previously participated, both Concierge and the custom agent post a reply, instead of only Concierge.
What is the root cause of that problem?
This is a server-side / backend agent dispatching issue, coupled with how PR #103367 surfaced agent visibility:
When a user sends a message in useComposerSubmit.ts, addComment calls API.write(SIDE_EFFECT_REQUEST_COMMANDS.ADD_COMMENT, ...) with parameters defined in src/libs/API/parameters/AddCommentOrAttachmentParams.ts:3-21.
The client application passes only the raw message/HTML (reportComment) without resolving or restricting dispatch to specific agent participants. The backend parses mentions and triggers background Webhook / LLM processing jobs (ProcessAgentZeroRequest).
On the backend, when a custom agent has joined a report (either via previous @mention or invite during PR [Payment due @ikevin127] Show the 👍/👎 feedback prompt under custom agent replies #103367 test steps), the backend agent dispatcher evaluates messages posted in that report and mistakenly dispatches incoming messages to all active report agents even when an explicit @Concierge mention specifies Concierge as the sole target.
What changes do you think we should make in order to solve the problem?
Backend Change (Primary Fix):
In Auth/Web-Expensify agent dispatcher (ProcessAgentZeroRequest):
When a comment contains an explicit mention targeting @Concierge (or another specific agent by accountID), suppress automated trigger events for any other custom agents registered as participants in that report, unless they are also explicitly mentioned in the comment text.
Frontend Client Safeguard (If resolved client-side via parameters or action filtering):
If Expensify prefers client-side mention hints to avoid unnecessary webhook dispatches:
In src/libs/ReportUtils.ts / src/pages/inbox/report/ReportActionCompose/useComposerSubmit.ts:
Parse mention tags in the comment. If @Concierge or a specific agent mention is detected, populate a target dispatch hint parameter (e.g., targetedAgentAccountIDs: [CONST.ACCOUNT_ID.CONCIERGE]) in AddCommentOrAttachmentParams.
This ensures the backend dispatcher knows immediately whether the query is strictly directed to Concierge or intended for multiple agents.
What alternative solutions did you explore? (Optional)
Client-side filtering of optimistic or incoming actions: rejected because both responses are genuine backend actions created in the DB and suppressing one on the client would cause synchronization mismatches across devices.
Please re-state the problem that we are trying to solve in this issue.
When sending a message explicitly mentioning @Concierge (e.g., @Concierge what is this report's total?) in an expense report after creating a custom agent via Account → Agents → New Agent → Build Custom Agent, both Concierge and the custom agent post separate replies, instead of only Concierge responding.
What is the root cause of that problem?
This is a server-side agent dispatching & mention targeting issue in the AgentZero processing pipeline:
In the client, addComment (src/libs/actions/Report.ts) invokes API.write(SIDE_EFFECT_REQUEST_COMMANDS.ADD_COMMENT, ...) passing AddCommentOrAttachmentParams (src/libs/API/parameters/AddCommentOrAttachmentParams.ts). The client sends the comment HTML in reportComment without filtering or dictating which agent backend worker should process the prompt.
On the backend (Expensify/Auth and Web-Expensify), when a user creates a custom agent, the agent is registered with agent capabilities for the user's active reports/workspaces.
When a comment is added to an expense report, the server evaluates whether AgentZero / LLM processing should be triggered. However, the dispatcher triggers all eligible agent listeners (both Concierge and custom agents associated with the workspace/report) instead of evaluating the explicit mention tags in the comment to restrict execution exclusively to the tagged agent (@Concierge).
In Expensify/Auth / AgentZero dispatcher (ProcessAgentZeroRequest / shouldRunAgent):
Parse explicit mention tags within the comment HTML:
If the comment contains an explicit mention targeting @Concierge (accountID: CONST.ACCOUNT_ID.CONCIERGE), only invoke Concierge processing; do not trigger custom agent runners unless that custom agent is also explicitly @-mentioned.
If a specific custom agent is mentioned by name, only invoke that specific custom agent.
If no specific agent is mentioned (or if both are mentioned), follow standard multi-agent dispatch rules.
2. Client-Side Consideration (If Expensify prefers a client-side intent hint):
If Expensify prefers that the client specifies target agent scope directly to avoid backend mention re-parsing:
In src/libs/API/parameters/AddCommentOrAttachmentParams.ts:
Add an optional parameter targetedAgentAccountIDs?: number[].
In src/pages/inbox/report/ReportActionCompose/useComposerSubmit.ts / Report.ts:addComment:
Extract mentioned account IDs from the composer comment. If an agent (such as Concierge or custom agent) is explicitly targeted, pass its accountID in targetedAgentAccountIDs.
The backend can then respect targetedAgentAccountIDs to dispatch only to the requested agent.
What alternative solutions did you explore? (Optional)
Client-side suppression/filtering of received report actions:
Rejecting or hiding the custom agent action on the client when incoming via Onyx/Pusher is strongly discouraged because the custom agent response is a persistent database record created by the backend. Suppressing it on one client would cause message count and thread inconsistencies across platforms and webhooks. The dispatch must be gated at the source.
Activity
applause-bot commentedon Oct 19, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/9a0e45c13c343fbf265ed30462ba1709926dde1356398e3babf46388f57b8488
MelvinBot commentedon Oct 19, 2026
Issue Analysis
Root Cause: This appears to be a backend/internal issue. A separate internal investigation is needed.
The App never tells the server which agent should reply. The server reads the comment and decides that on its own. PR 103367 did not cause the extra reply. It only adds the 👍/👎 prompt, which makes the agent's reply easier to notice.
Recommended Fix: The fix is outside the App repo. Please escalate to an internal engineer who can change how the backend picks which agents reply.
Investigation details
AddCommentsends only the report ID, the comment HTML and Concierge-specific fields. It sends no mentioned accounts and no agent IDs:src/libs/API/parameters/AddCommentOrAttachmentParams.ts:3-21. The@Conciergemention exists only inside the comment HTML.getFeedbackPromptActionIDsonly chooses which comments get the feedback prompt. The PR doesn't change any visibility or filtering logic, so the agent's reply would have shown before the PR too, just without the prompt. The report says the bug also reproduces in production.@-mention the agent in the same expense report. If the agent was mentioned there earlier, it may have joined the report and now replies to every comment. Please check the video to confirm whether the agent was mentioned before.Next Steps: Reply with
@MelvinBot <your feedback>to refine this analysis.view run
melvin-bot commentedon Oct 19, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak (
External)[-]– PR 103367 – Concierge – Custom Agent Replies When @Concierge Is Mentioned[/-][+][$175] – PR 103367 – Concierge – Custom Agent Replies When @Concierge Is Mentioned[/+]melvin-bot commentedon Oct 19, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022112316544088484422
camesenin commentedon Oct 19, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When sending a message mentioning
@Concierge(e.g.@Concierge what is this report's total?) in an expense report where a custom agent previously participated, both Concierge and the custom agent post a reply, instead of only Concierge.What is the root cause of that problem?
This is a server-side / backend agent dispatching issue, coupled with how PR #103367 surfaced agent visibility:
useComposerSubmit.ts,addCommentcallsAPI.write(SIDE_EFFECT_REQUEST_COMMANDS.ADD_COMMENT, ...)with parameters defined insrc/libs/API/parameters/AddCommentOrAttachmentParams.ts:3-21.reportComment) without resolving or restricting dispatch to specific agent participants. The backend parses mentions and triggers background Webhook / LLM processing jobs (ProcessAgentZeroRequest).@mentionor invite during PR [Payment due @ikevin127] Show the 👍/👎 feedback prompt under custom agent replies #103367 test steps), the backend agent dispatcher evaluates messages posted in that report and mistakenly dispatches incoming messages to all active report agents even when an explicit@Conciergemention specifies Concierge as the sole target.getFeedbackPromptActionIDsinsrc/libs/ReportActionsUtils.ts:1831which computes feedback prompts for[CONST.ACCOUNT_ID.CONCIERGE, ...customAgentAccountIDs]. While PR [Payment due @ikevin127] Show the 👍/👎 feedback prompt under custom agent replies #103367 made custom agent responses prominent by adding feedback prompts beneath them, it revealed that the backend does not enforce mutual exclusion or target filtering when a specific agent (@concierge) is explicitly targeted.What changes do you think we should make in order to solve the problem?
Backend Change (Primary Fix):
In Auth/Web-Expensify agent dispatcher (
ProcessAgentZeroRequest):@Concierge(or another specific agent byaccountID), suppress automated trigger events for any other custom agents registered as participants in that report, unless they are also explicitly mentioned in the comment text.Frontend Client Safeguard (If resolved client-side via parameters or action filtering):
If Expensify prefers client-side mention hints to avoid unnecessary webhook dispatches:
src/libs/ReportUtils.ts/src/pages/inbox/report/ReportActionCompose/useComposerSubmit.ts:Parse mention tags in the comment. If
@Conciergeor a specific agent mention is detected, populate a target dispatch hint parameter (e.g.,targetedAgentAccountIDs: [CONST.ACCOUNT_ID.CONCIERGE]) inAddCommentOrAttachmentParams.What alternative solutions did you explore? (Optional)
Client-side filtering of optimistic or incoming actions: rejected because both responses are genuine backend actions created in the DB and suppressing one on the client would cause synchronization mismatches across devices.
Contributor details
Your Expensify account email: camesenin@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~0170d6b02e9440e604
melvin-bot commentedon Oct 19, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
sijo0218 commentedon Oct 20, 2026
Contributor details
Your Expensify account email: sijo0218@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~011091133bbb09cd1c
Proposal
Please re-state the problem that we are trying to solve in this issue.
When sending a message explicitly mentioning
@Concierge(e.g.,@Concierge what is this report's total?) in an expense report after creating a custom agent viaAccount → Agents → New Agent → Build Custom Agent, both Concierge and the custom agent post separate replies, instead of only Concierge responding.What is the root cause of that problem?
This is a server-side agent dispatching & mention targeting issue in the AgentZero processing pipeline:
addComment(src/libs/actions/Report.ts) invokesAPI.write(SIDE_EFFECT_REQUEST_COMMANDS.ADD_COMMENT, ...)passingAddCommentOrAttachmentParams(src/libs/API/parameters/AddCommentOrAttachmentParams.ts). The client sends the comment HTML inreportCommentwithout filtering or dictating which agent backend worker should process the prompt.Expensify/Authand Web-Expensify), when a user creates a custom agent, the agent is registered with agent capabilities for the user's active reports/workspaces.@Concierge).PR [Payment due @ikevin127] Show the 👍/👎 feedback prompt under custom agent replies #103367 introduced inline
👍/👎feedback prompts for custom agents (getFeedbackPromptActionIDsinsrc/libs/ReportActionsUtils.ts:1831). Step 5-6 of PR [Payment due @ikevin127] Show the 👍/👎 feedback prompt under custom agent replies #103367's QA test plan instructed testers to create and interact with a custom agent in the report. Once the custom agent was active, subsequent@Conciergequeries triggered both listeners, and the new feedback prompt on the custom agent made the double-reply immediately obvious.What changes do you think we should make in order to solve the problem?
1. Server-Side / Backend Fix (Authoritative Resolution):
In
Expensify/Auth/ AgentZero dispatcher (ProcessAgentZeroRequest/shouldRunAgent):@Concierge(accountID: CONST.ACCOUNT_ID.CONCIERGE), only invoke Concierge processing; do not trigger custom agent runners unless that custom agent is also explicitly@-mentioned.2. Client-Side Consideration (If Expensify prefers a client-side intent hint):
If Expensify prefers that the client specifies target agent scope directly to avoid backend mention re-parsing:
src/libs/API/parameters/AddCommentOrAttachmentParams.ts:Add an optional parameter
targetedAgentAccountIDs?: number[].src/pages/inbox/report/ReportActionCompose/useComposerSubmit.ts/Report.ts:addComment:Extract mentioned account IDs from the composer comment. If an agent (such as Concierge or custom agent) is explicitly targeted, pass its
accountIDintargetedAgentAccountIDs.targetedAgentAccountIDsto dispatch only to the requested agent.What alternative solutions did you explore? (Optional)
Rejecting or hiding the custom agent action on the client when incoming via Onyx/Pusher is strongly discouraged because the custom agent response is a persistent database record created by the backend. Suppressing it on one client would cause message count and thread inconsistencies across platforms and webhooks. The dispatch must be gated at the source.
melvin-bot commentedon Oct 20, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
melvin-bot commentedon Oct 23, 2026
@eVoloshchak Whoops! This issue is 2 days overdue. Let's get this updated quick!
eVoloshchak commentedon Oct 26, 2026
Agree. @MelvinBot, please make this Internal
eVoloshchak commentedon Oct 26, 2026
This needs to be internal
🎀👀🎀 C+ reviewed!
melvin-bot commentedon Oct 26, 2026
Triggered auto assignment to @blimpich, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
MelvinBot commentedon Oct 26, 2026
Done. I removed the
Externallabel and addedInternal.The fix needs a backend change to how agents are picked to reply, so an internal engineer needs to take it.
blimpichis already assigned.view run
blimpich commentedon Oct 26, 2026
asked for a volunteer here: https://expensify.slack.com/archives/C086VHWPPUM/p1793058987759509
hungvu193 commentedon Oct 27, 2026
Working on BE PR
hungvu193 commentedon Oct 27, 2026
It's now ready for review @blimpich 🙇
blimpich commentedon Oct 27, 2026
Merged backend PR, should get deployed today or tomorrow