Skip to content

[Due for payment 2026-06-19] [Due for payment 2026-06-18] Revert workflows-related functionality for AI agents #93315

Closed

Description

@melvin-bot

The workflows-related functionality that was added for AI agents should be reverted.

Related issues:

Activity

  1. melvin-bot commented on Jun 11, 2026

    @melvin-bot
    Author

    Triggered auto assignment to Design team member for new feature review - @dannymcclain (NewFeature)

  2. puneetlath commented on Jun 11, 2026

    @puneetlath
    Contributor

    @MelvinBot can you make a proposal for this? Basically we want to revert the "Automate approvals with agents" banner in the workflows section. The "add agent" button in the workflows section. And anything else agent-related that you see in the workflows section of the workspace settings.

  3. MelvinBot commented on Jun 11, 2026

    @MelvinBot
    Contributor

    Proposal

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

    Remove the AI‑agent functionality from the workspace Workflows section: the "Automate approvals with agents" promo banner, the "Add agent" pill on approval‑workflow cards, and the supporting add‑agent flow / deferred‑save plumbing that lives in the Workflows pages. Agents stay available elsewhere — only the Workflows‑section integration is being reverted. The AI‑Rules surface is handled separately by Expensify/App#93313 and Expensify/App#93314.

    What is the root cause of that problem?

    Not a bug — a product decision to pull agents out of the Workflows surface. The Workflows‑section integration was introduced by:

    • Expensify/App#91251 — agent promotion banners on workspace pages
    • Expensify/App#91441 — add agent to workflow approval (the "Add agent" pill, the add‑agent flow, and the deferred‑save logic)
    • Expensify/App#92718 — follow‑up that preserves the approver draft in the Add agent → upgrade flow

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

    Do a surgical removal of the Workflows‑section integration rather than a full PR revert (#91251 also added the AI‑Rules banner that we're intentionally keeping per #93314, and main has moved on top — so a clean git revert isn't possible without collateral damage).

    Remove / revert (Workflows section only):

    1. Banner — the AgentPromotionalBanner block + its isCustomAgentBetaEnabled / isAgentsWorkflowsBannerDismissed gating in WorkspaceWorkflowsPage.tsx.
    2. "Add agent" pill — onAddAgentPress, canAddAgent, and shouldShowAddAgentButton in ApprovalWorkflowSection.tsx.
    3. Add‑agent entry + deferred‑save logic in WorkspaceWorkflowsPage.tsx and WorkspaceWorkflowsApprovalsEditPage.tsx (useAddAgentToApprovalWorkflow, useDeferredAgentWorkflowReconciliation, queueDeferredAgentWorkflowSave, clearPendingAgentFromApprovalWorkflow, the seed‑approver / optimistic‑agent overlay).
    4. Workflows‑only hooks — delete useAddAgentToApprovalWorkflow.ts and useDeferredAgentWorkflowReconciliation.ts.
    5. Deferred‑save helpers in libs/actions/Workflow.ts (buildDeferredAgentWorkflowSaveKey, queueDeferredAgentWorkflowSave, clearDeferredAgentWorkflowSave).
    6. Route / screen — WORKSPACE_WORKFLOWS_ADD_AGENT in ROUTES.ts, SCREENS.ts, ModalStackNavigators, linkingConfig/config.ts, WORKSPACE_TO_RHP.ts, and Navigation/types.ts.
    7. Strings — automateApprovalsWithAgentsTitle, automateApprovalsWithAgentsSubtitle, addAgentAction across all locale files.
    8. Onyx keys used only by this flow — DEFERRED_AGENT_WORKFLOW_SAVES, OPTIMISTIC_AGENT_ACCOUNT_ID_MAPPING, and types/onyx/DeferredAgentWorkflowSave.ts.
    9. Constants — AGENTS_WORKFLOWS_BANNER and its SENTRY_LABEL entry in CONST.

    Keep (out of scope — used by Settings > Agents and/or AI Rules): src/pages/settings/Agents/*, the core libs/actions/Agent.ts (createAgent etc.), the AgentPromotionalBanner.tsx component itself (still used on the AI Rules page), the Settings AGENTS screens, SessionUtils.useIsAgentAccount, the AgentPrompt Onyx type, and CONST.BETAS.CUSTOM_AGENT.

    ⚠️ One scoping decision to confirm before implementing: is this only pulling agents out of Workflows (agents still creatable from Settings > Agents / AI Rules), or is it part of a wider agent rollback? If it's the latter, we'd also remove the Settings > Agents pages, the Agent.ts action module, and the CUSTOM_AGENT beta. The list above assumes Workflows‑only.

    What alternative solutions did you explore?

    • Full git revert of #91251 / #91441 / #92718 — rejected: #91251 also added the AI‑Rules banner we're keeping (#93314), and main has advanced on top, so a clean revert would either fail or drag in unrelated changes.
    • Beta‑gate only (flip CUSTOM_AGENT off) — hides the Workflows UI without deleting code. Fastest mitigation if the goal is just to hide it now, but it doesn't actually remove the feature from the codebase. Note this also hides the AI‑Rules banner, so it's not a clean substitute given #93314.
    Key code references

    (Line numbers are from the current snapshot and may drift by a few lines on main.)


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/93315) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

  4. puneetlath commented on Jun 11, 2026

    @puneetlath
    Contributor

    ⚠️ One scoping decision to confirm before implementing: is this only pulling agents out of Workflows (agents still creatable from Settings > Agents / AI Rules), or is it part of a wider agent rollback? If it's the latter, we'd also remove the Settings > Agents pages, the Agent.ts action module, and the CUSTOM_AGENT beta. The list above assumes Workflows‑only.

    @MelvinBot we are only removing agents from the Workflows page. Not removing agents altogether. Please implement the proposal.

  5. MelvinBot commented on Jun 11, 2026

    @MelvinBot
    Contributor

    ⏱️ Ran out of time before I could finish. This usually means the task was too complex or I got stuck exploring. Please try again with a more specific request or post in #melvinbot-ai.

    Run details

  6. puneetlath commented on Jun 11, 2026

    @puneetlath
    Contributor

    @MelvinBot can you try first just reverting the banner and "add agent" pill?

  7. MelvinBot commented on Jun 11, 2026

    @MelvinBot
    Contributor

    🤖 Draft PR created: #93325

    As requested, this is the minimal first step — it removes only the "Automate approvals with agents" promo banner and the "Add agent" pill from the Workflows section. The shared AgentPromotionalBanner component (still used by the AI Rules page), the AI Rules banner, and the deferred agent-workflow save plumbing are intentionally left in place. The deeper revert (routes, hooks, Onyx keys, locale strings, CONST entries) is a deferred follow-up per the proposal.

    Please mark it as "Ready for review" when it is ready for review.

  8. 1 remaining item

  9. changed the title [-]Revert workflows-related functionality for AI agents[/-] [+][Due for payment 2026-06-18] Revert workflows-related functionality for AI agents[/+] on Jun 11, 2026
  10. melvin-bot commented on Jun 11, 2026

    @melvin-bot
    Author

    Reviewing label has been removed, please complete the "BugZero Checklist".

  11. melvin-bot commented on Jun 11, 2026

    @melvin-bot
    Author

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.5-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-06-18. 🎊

  12. melvin-bot commented on Jun 11, 2026

    @melvin-bot
    Author

    BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

    • [@puneetlath] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.
    • [] Link the GH issue for creating/updating the regression test once above steps have been agreed upon.

    If no checklist is needed for this issue and you have the K2 extension, you can click: [no checklist button]

  13. changed the title [-][Due for payment 2026-06-18] Revert workflows-related functionality for AI agents[/-] [+][Due for payment 2026-06-19] [Due for payment 2026-06-18] Revert workflows-related functionality for AI agents[/+] on Jun 12, 2026
  14. melvin-bot commented on Jun 12, 2026

    @melvin-bot
    Author

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.6-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-06-19. 🎊

  15. melvin-bot commented on Jun 12, 2026

    @melvin-bot
    Author

    BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

    • [@puneetlath] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.
    • [] Link the GH issue for creating/updating the regression test once above steps have been agreed upon.

    If no checklist is needed for this issue and you have the K2 extension, you can click: [no checklist button]

  16. melvin-bot commented on Jun 15, 2026

    @melvin-bot
    Author

    @puneetlath, @dannymcclain Whoops! This issue is 2 days overdue. Let's get this updated quick!

  17. puneetlath commented on Jun 16, 2026

    @puneetlath
    Contributor

    This was done.

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions