Skip to content

[Bug 649034] Track the Expense Agent activator - #11293

Draft
Prangshuman Das (t-prda) wants to merge 7 commits into
mainfrom
fix/649034-expense-agent-configured-by
Draft

[Bug 649034] Track the Expense Agent activator#11293
Prangshuman Das (t-prda) wants to merge 7 commits into
mainfrom
fix/649034-expense-agent-configured-by

Conversation

@t-prda

@t-prda Prangshuman Das (t-prda) commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Status: unresolved - keep draft

Playwright reproduced the failure on tenant2-1, company CRONUS W1: PRDAS successfully activated Expense Agent, but the EA avatar task pane still displayed Configured by TESTUSER2 after reopening. The User row modifier changed to PRDAS; the Agent Data modifier did not.

The previous helper diagnostic was not proof of a fix: it ran as the user already recorded in Agent Data. The proposed no-op attribution write below is therefore not validated and does not fix the reproduced scenario.

Read-only runtime inspection explains the no-op behavior: equal assignments are optimized away; Agent Data has a system modify trigger, so same-value ModifyAll also falls back to the same path. SOA's enabled save additionally updates instructions through Agent.SetInstructions; the identity-sync explanation alone was incomplete.

Do not merge or backport this draft until a supported audit-update fix passes the actual two-user UI scenario.

Proposed changes (not a verified fix)

  • touch the logical Agent record after a successful activation so SystemModifiedBy identifies the latest activator
  • centralize Agent-framework operations in the permission-bearing EA Setup Mgt. codeunit
  • preserve the existing attribution for deactivation and settings-only saves, matching Sales Order Agent behavior
  • leave cancellation and failed-save paths unchanged

Validation

  • resolved the W1 local environment explicitly for tenant2-1
  • downloaded app and test-app symbols from tenant2-1 into isolated project caches
  • built and published Expense Agent (Preview) 30.0.0.0 to tenant2-1
  • built and published Expense Agent Tests 30.0.0.0 to tenant2-1
  • manually reproduced that Expense Agent activation did not refresh the logical Agent modifier, while Sales Order Agent activation did
  • no new regression test was added because Sales Order Agent and Payables Agent do not cover this attribution behavior
  • automated test execution was skipped because the available MCP runner cannot guarantee Codeunit isolation and the canonical dispatch runner was unavailable

Integration notes

Fixes AB#649034

Refresh the platform Agent record only after successful Expense Agent setup persistence so the sidecar identifies the latest configuring administrator.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 988fb581-008c-4e0d-99c1-285cd45d49e7
@github-actions github-actions Bot added the AL: Apps (W1) Add-on apps for W1 label Sep 10, 2026
@github-actions github-actions Bot added this to the Version 30.0 milestone Sep 10, 2026
@github-actions github-actions Bot added the Team: Finance GitHub request for Finance area label Sep 10, 2026
Mark the platform setup buffer as updated when Expense Agent-specific configuration changes so Agent Setup owns the attribution write.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 988fb581-008c-4e0d-99c1-285cd45d49e7
Force the platform Agent update only when an existing Expense Agent is activated, reactivated, or deactivated. Settings-only saves preserve the previous attribution.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 988fb581-008c-4e0d-99c1-285cd45d49e7
@t-prda Prangshuman Das (t-prda) changed the title [Bug 649034] Update Expense Agent configured-by attribution [Bug 649034] Track Expense Agent lifecycle administrator Sep 10, 2026
Update the logical Agent record through a permission-bearing helper after successful activation so Configured by tracks the last activator, matching Sales Order Agent behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 988fb581-008c-4e0d-99c1-285cd45d49e7
@t-prda Prangshuman Das (t-prda) changed the title [Bug 649034] Track Expense Agent lifecycle administrator [Bug 649034] Track the Expense Agent activator Sep 11, 2026
Use an object ID that is free across the Expense Agent app family so localized builds and backports can consume the W1 app without a collision.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 988fb581-008c-4e0d-99c1-285cd45d49e7
Assign the unchanged display name before modifying the logical Agent record so code analysis recognizes the intentional attribution update.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 988fb581-008c-4e0d-99c1-285cd45d49e7
Rename the attribution helper to EA Setup Mgt. and move Agent identity resolution, change detection, setup persistence, and activator attribution behind the shared setup boundary.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 988fb581-008c-4e0d-99c1-285cd45d49e7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1 ExpenseManagement Team: Finance GitHub request for Finance area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant